當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Redirect::to方法代碼示例

本文整理匯總了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');
 }
開發者ID:a1ex7,項目名稱:librauth,代碼行數:7,代碼來源:AuthController.php

示例2: pmReportTag

 public function pmReportTag($id)
 {
     $report = PmReport::find($id);
     $report->tag = 1;
     $report->save();
     return Redirect::to('/pm')->with('message', 'Report Taged!');
 }
開發者ID:jerryhanks,項目名稱:Melport,代碼行數:7,代碼來源:PmController.php

示例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);
 }
開發者ID:jimpeeters,項目名稱:Win4LifeBonus,代碼行數:7,代碼來源:UserController.php

示例4: emptyLogs

 public function emptyLogs()
 {
     ActionLog::truncate();
     $message['result'] = 1;
     $message['content'] = $message['result'] ? '清空日誌成功' : '清空日誌失敗';
     return Redirect::to('admin/actionLogs/')->with('message', $message);
 }
開發者ID:loopeer,項目名稱:quickcms,代碼行數:7,代碼來源:LogController.php

示例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);
 }
開發者ID:ssx,項目名稱:threeohone,代碼行數:40,代碼來源:CheckForRedirect.php

示例6: videoSil

 function videoSil($videoSil)
 {
     $videoSil = DB::delete("delete from videolar where id = ?", array($videoSil));
     if ($videoSil > 0) {
         return Redirect::to('admin/video');
     }
 }
開發者ID:hakanozer,項目名稱:laravelAdmin,代碼行數:7,代碼來源:videoController.php

示例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');
 }
開發者ID:shinichi81,項目名稱:laravel-admin,代碼行數:7,代碼來源:RolesController.php

示例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');
         }
     }
 }
開發者ID:Omniarate,項目名稱:omniaratedev1,代碼行數:35,代碼來源:UploadApplyController.php

示例9: doLogout

 public function doLogout()
 {
     Auth::logout();
     // log the user out of our application
     return Redirect::to('/');
     // redirect the user to the login screen
 }
開發者ID:amitavroy,項目名稱:Tranvas,代碼行數:7,代碼來源:UserController.php

示例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);
 }
開發者ID:unpetitlu,項目名稱:laravelcinema,代碼行數:33,代碼來源:CartController.php

示例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();
 }
開發者ID:venomir,項目名稱:tc,代碼行數:30,代碼來源:ProductImageController.php

示例12: store

 public function store(OrderRequest $request)
 {
     $order = $request->all();
     $order['user_id'] = Auth::id();
     Order::create($order);
     return Redirect::to("/?timer=true");
 }
開發者ID:Niiwill,項目名稱:pizzaApp,代碼行數:7,代碼來源:WelcomeController.php

示例13: delete

 public function delete($id)
 {
     $song = Song::find($id);
     $song->delete();
     Session()->flash('deletesong', 'Song is Deleted');
     return Redirect::to('song');
 }
開發者ID:asifrafeeq,項目名稱:Code-Repository,代碼行數:7,代碼來源:SongController.php

示例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!');
 }
開發者ID:SAEMA,項目名稱:project,代碼行數:7,代碼來源:Reset_pwdController.php

示例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');
     }
 }
開發者ID:sandyp143,項目名稱:attendance-system,代碼行數:27,代碼來源:AttendanceController.php


注:本文中的Illuminate\Support\Facades\Redirect::to方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。