本文整理汇总了PHP中Illuminate\Support\Facades\Redirect::to方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::to方法的具体用法?PHP Redirect::to怎么用?PHP Redirect::to使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Redirect
的用法示例。
在下文中一共展示了Redirect::to方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleFbCallback
public function handleFbCallback()
{
$fb_user = Socialite::driver('facebook')->user();
$user = User::firstOrCreate(['firstname' => $fb_user->user['first_name'], 'lastname' => $fb_user->user['last_name'], 'email' => $fb_user->email]);
Auth::login($user, true);
return Redirect::to('/books');
}
示例2: pmReportTag
public function pmReportTag($id)
{
$report = PmReport::find($id);
$report->tag = 1;
$report->save();
return Redirect::to('/pm')->with('message', 'Report Taged!');
}
示例3: restore
public function restore($id)
{
$specificUser = User::withTrashed()->find($id);
$specificUser->restore();
$users = User::where('admin1_user0', '=', 0)->withTrashed()->get();
return Redirect::to('dashboard')->with('users', $users);
}
示例4: emptyLogs
public function emptyLogs()
{
ActionLog::truncate();
$message['result'] = 1;
$message['content'] = $message['result'] ? '清空日志成功' : '清空日志失败';
return Redirect::to('admin/actionLogs/')->with('message', $message);
}
示例5: handle
/**
* Handle an incoming request, check to see if we have a redirect in place for the requested URL
* and then redirect if we do have a match
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
// Get the full URL that has been requested, minus the protocol
$full_url = str_replace($request->getScheme() . "://", "", $request->url());
// Check for any results matching the full domain request
$results = Redirect::where("type", "domain")->where("from", $full_url)->where("status", "active");
if ($results->exists()) {
// Get the first result back
$redirect = $results->first();
// Grab the URL before we increment
$url = $redirect->to;
// Increment the hit count
$redirect->increment('hits');
// Redirect off to where we're going
return RedirectFacade::to($url);
}
// Check for any results matching the path only
$results = Redirect::where("type", "path")->where("from", "/" . $request->path())->where("status", "active");
// If a redirect exists for this, process it and redirect
if ($results->exists()) {
// Get the first result back
$redirect = $results->first();
// Grab the URL before we increment
$url = $redirect->to;
// Increment the hit count
$redirect->increment('hits');
// Redirect off to where we're going
return RedirectFacade::to($url, 301);
}
// By default, continue afterwards and bail out
return $next($request);
}
示例6: videoSil
function videoSil($videoSil)
{
$videoSil = DB::delete("delete from videolar where id = ?", array($videoSil));
if ($videoSil > 0) {
return Redirect::to('admin/video');
}
}
示例7: destroy
public function destroy($id)
{
$role = $this->model->findOrFail($id);
$role->delete();
flash()->success(trans('LaravelAdmin::laravel-admin.rolDeleteSuccess'));
return Redirect::to('backend/roles');
}
示例8: store
public function store()
{
// getting all of the post data
$file = array('image' => Input::file('image'));
$input = Request::all();
$image = $input['image'];
// setting up rules
$rules = array('image' => 'required');
//mimes:jpeg,bmp,png and for max size max:10000
// doing the validation, passing post data, rules and the messages
$validator = Validator::make($image, $rules);
if ($validator->fails()) {
// send back to the page with the input data and errors
return Redirect::to('/')->withInput()->withErrors($validator);
} else {
// checking file is valid.
if (Input::file('image')->isValid()) {
$destinationPath = '/uploads/images';
// upload path
$extension = Input::file('image')->getClientOriginalExtension();
// getting image extension
$fileName = rand(11111, 99999) . '.' . $extension;
// renameing image
Input::file('image')->move($destinationPath, $fileName);
// uploading file to given path
// sending back with message
Session::flash('success', 'Upload successfully');
return Redirect::to('upload');
} else {
// sending back with error message.
Session::flash('error', 'uploaded file is not valid');
return Redirect::to('upload');
}
}
}
示例9: doLogout
public function doLogout()
{
Auth::logout();
// log the user out of our application
return Redirect::to('/');
// redirect the user to the login screen
}
示例10: checkout
/**
* Payments
*/
public function checkout()
{
$ids = session('likes', []);
$total = 0;
foreach ($ids as $id) {
$movie = Movies::find($id);
$total = $total + $movie->price;
}
$payer = PayPal::Payer();
$payer->setPaymentMethod('paypal');
$amount = PayPal::Amount();
$amount->setCurrency('EUR');
$amount->setTotal($total);
$transaction = PayPal::Transaction();
$transaction->setAmount($amount);
$transaction->setDescription("Récapitulatif total des " . count($ids) . " films commandés");
$redirectUrls = PayPal::RedirectUrls();
$redirectUrls->setReturnUrl(route('cart_done'));
$redirectUrls->setCancelUrl(route('cart_cancel'));
$payment = PayPal::Payment();
$payment->setIntent('sale');
$payment->setPayer($payer);
$payment->setRedirectUrls($redirectUrls);
$payment->setTransactions(array($transaction));
//response de Paypal
$response = $payment->create($this->_apiContext);
$redirectUrl = $response->links[1]->href;
//redirect to Plateform Paypal
return Redirect::to($redirectUrl);
}
示例11: postCreate
public function postCreate()
{
$validator = Validator::make(Input::all(), ProductImage::$rules);
if ($validator->passes()) {
$images = Input::file('images');
$file_count = count($images);
$uploadcount = 0;
foreach ($images as $image) {
if ($image) {
$product_image = new ProductImage();
$product_image->product_id = Input::get('product_id');
$product_image->title = $image->getClientOriginalName();
$filename = date('Y-m-d-H:i:s') . "-" . $product_image->title;
$path = public_path('img/products/' . $filename);
$path_thumb = public_path('img/products/thumb/' . $filename);
Image::make($image->getRealPath())->resize(640, 480)->save($path);
Image::make($image->getRealPath())->resize(177, 177)->save($path_thumb);
$product_image->url = $filename;
$product_image->save();
$uploadcount++;
}
}
if ($uploadcount == $file_count) {
return Redirect::back();
} else {
return Redirect::back()->with('message', 'Ошибка загрузки фотографии');
}
}
return Redirect::to('admin/products/index')->with('message', 'Ошибка сохранения')->withErrors($validator)->withInput();
}
示例12: store
public function store(OrderRequest $request)
{
$order = $request->all();
$order['user_id'] = Auth::id();
Order::create($order);
return Redirect::to("/?timer=true");
}
示例13: delete
public function delete($id)
{
$song = Song::find($id);
$song->delete();
Session()->flash('deletesong', 'Song is Deleted');
return Redirect::to('song');
}
示例14: reset_pwd
public function reset_pwd(Request $request)
{
$update_pwd = User::find(\Auth::user()->id);
$update_pwd->password = $request->input('password');
$update_pwd->save();
return Redirect::to('facebook_welcome')->with('message', 'Password updated successfully!');
}
示例15: getAttendance
function getAttendance($member = '')
{
$input = Input::all();
if ($member == null or $member == '') {
$memberId = Session::get('memberId');
} else {
$memberId = $member;
}
if (array_key_exists('date', $input)) {
$year = date("Y", strtotime($input['date']));
$startDate = $year . '-01-01';
$endDate = $startDate . '12-31';
} else {
$year = date("Y");
$startDate = $year . '-01-01';
$endDate = $year . '-12-31';
}
$month = array_key_exists('month', $input) ? $input['month'] : date('F');
$month = Month::ForMonth($month)->first();
if (!empty($month)) {
$attendance = $month->attendances()->DateBetween($startDate, $endDate)->ForMember($memberId)->get();
$attendances = $this->AverageMonthAttendance($attendance, $month, $year);
return $attendances;
} else {
return Redirect::to('/auth/dashboard')->withFlashMessage('No Attendnce for the month');
}
}