当前位置: 首页>>代码示例>>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;未经允许,请勿转载。