当前位置: 首页>>代码示例>>PHP>>正文


PHP Redirect::home方法代码示例

本文整理汇总了PHP中Illuminate\Support\Facades\Redirect::home方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::home方法的具体用法?PHP Redirect::home怎么用?PHP Redirect::home使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Facades\Redirect的用法示例。


在下文中一共展示了Redirect::home方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check()) {
         return Redirect::home();
     }
     return $next($request);
 }
开发者ID:sabahtalateh,项目名称:laracast,代码行数:14,代码来源:RedirectIfAuthenticated.php

示例2: store

 /**
  * @param Requests\SignUpRequest $request
  * @param CommandDispatcher $commandDispatcher
  *
  * @return
  */
 public function store(Requests\SignUpRequest $request, CommandDispatcher $commandDispatcher)
 {
     $commandDispatcher->dispatchFrom(RegisterUser::class, $request);
     \Auth::login(User::where('username', $request['username'])->first());
     Flash::overlay('Welcome!!');
     return Redirect::home();
 }
开发者ID:sabahtalateh,项目名称:laracast,代码行数:13,代码来源:RegistrationController.php

示例3: destroy

 public function destroy($id)
 {
     $user = $this->userRepository->findById($id);
     if ($this->userRepository->delete($user)) {
         return Redirect::home()->with('success', 'word.deleted');
     }
     return Redirect::back('/')->with('errors', 'word.error');
 }
开发者ID:christiannwamba,项目名称:laravel-site,代码行数:8,代码来源:UserController.php

示例4: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $headline = Headline::where('uid', $id)->first();
     if ($headline) {
         return view('headline', ['headline' => $headline]);
     }
     return Redirect::home();
 }
开发者ID:stefanledin,项目名称:klickrubrik,代码行数:14,代码来源:HeadlineController.php

示例5: store

 public function store()
 {
     $this->registrationForm->validate(Input::all());
     $user = $this->execute(RegisterUserCommand::class);
     Auth::login($user);
     Flash::overlay('WELCOME! Glad to have you as a new Larabook member!');
     return Redirect::home();
 }
开发者ID:HinchK,项目名称:xtpg-larabook,代码行数:8,代码来源:RegistrationController.php

示例6: index

 /**
  * Show the Administrator panel.
  *
  * @return \Illuminate\View\View
  */
 public function index()
 {
     try {
         $user = Auth::user()->with('projects')->where('id', '=', '2')->firstOrFail();
     } catch (ModelNotFoundException $e) {
         return Redirect::home();
     }
     // if it's admin, redirect to admin cms with all users but admin
     $allUsers = User::whereNotIn('id', [2])->get();
     $allSponsors = Sponsor::all();
     // Retrieve all projects pending approval.
     $pendingProjects = Project::where('approved', '=', '0')->where('application_status', '=', '1')->where('live', '=', '0')->get();
     return view('adminpanel.index', compact('user', 'allUsers', 'pendingProjects', 'allSponsors'));
 }
开发者ID:andreikainer,项目名称:kuj_abol,代码行数:19,代码来源:AdminController.php

示例7: loginPost

 /**
  * Logs the user in.
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function loginPost()
 {
     $loginData = Request::only(['login', 'password']);
     // Login with username or email.
     $loginKey = Str::contains($loginData['login'], '@') ? 'email' : 'username';
     $loginData[$loginKey] = array_pull($loginData, 'login');
     // Validate login credentials.
     if (Auth::validate($loginData)) {
         // Log the user in for one request.
         Auth::once($loginData);
         // We probably want to add support for "Remember me" here.
         Auth::attempt($loginData);
         //return Redirect::intended('/')
         return Redirect::home()->withSuccess(trans('gitamin.signin.success'));
     }
     return Redirect::route('auth.login')->withInput(Request::except('password'))->withError(trans('gitamin.signin.invalid'));
 }
开发者ID:xiaobailc,项目名称:Gitamin,代码行数:22,代码来源:AuthController.php

示例8: getLogout

 /**
  *
  */
 public function getLogout()
 {
     Auth::logout();
     return Redirect::home();
 }
开发者ID:virtualvendors,项目名称:altwallets,代码行数:8,代码来源:SessionsController.php

示例9: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store()
 {
     $user = User::create(Input::only('username', 'email', 'password'));
     Auth::login($user);
     return Redirect::home();
 }
开发者ID:BBK-SDP-2015-emassa01,项目名称:laravelJellibeans,代码行数:12,代码来源:UsersController.php

示例10: modelNotFoundError

 /**
  * generates an error response when the model is not found or redirects home with an error
  *
  * @param String $message the message to print
  * @return Response
  */
 protected function modelNotFoundError($message = 'elemento non trovato')
 {
     $data = array('error' => true, 'message' => $message);
     if ($this->isAjaxRequest()) {
         return $this->jsonResponse($data, 404);
     }
     return Redirect::home()->with('error', $message);
 }
开发者ID:whitegolem,项目名称:laracrud,代码行数:14,代码来源:BaseController.php

示例11: validateOwnership

 /**
  * Validate the ownership of a route.
  *
  * @param Route        $route
  * @param string       $parameter
  * @param string|array $fields
  *
  * @return \Illuminate\Http\RedirectResponse|null
  */
 protected function validateOwnership($route, $parameter, $fields = 'user_id')
 {
     $fields = (array) $fields;
     if (Auth::check()) {
         $user = Auth::user();
         // Gather fields
         $model = $route->getParameter($parameter);
         if (!$model) {
             return;
         }
         foreach ($fields as $key => $field) {
             $fields[$key] = $model->{$field};
         }
         // Validate ownership
         if ($model and !in_array($user->id, $fields)) {
             return Redirect::home();
         }
     }
 }
开发者ID:anahkiasen,项目名称:arrounded,代码行数:28,代码来源:AbstractSmartController.php

示例12: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id = null)
 {
     Auth::logout();
     return Redirect::home();
 }
开发者ID:raymondidema,项目名称:user-package,代码行数:12,代码来源:SessionController.php

示例13: getQueries

 /**
  * Get all queries by route.
  */
 protected function getQueries()
 {
     $crawler = $this->getCrawler();
     // Spoof Redirect::back
     $endpoint = Redirect::home();
     Redirect::shouldReceive('to')->andReturn($endpoint);
     Redirect::shouldReceive('back')->andReturn($endpoint);
     // Create Client
     $this->laravel['auth']->loginUsingId($this->user);
     $client = new Client($this->laravel, []);
     // Crawl routes
     $routes = $crawler->getRoutes();
     $this->info('Found ' . count($routes) . ' routes');
     foreach ($routes as $route) {
         $this->inspect($client, $route);
     }
 }
开发者ID:anahkiasen,项目名称:arrounded,代码行数:20,代码来源:BenchQueries.php

示例14: show

 /**
  * Display the specified resource.
  *
  * @param $username
  * @internal param int $id
  * @return Response
  */
 public function show($username)
 {
     try {
         $user = Auth::user()->with('projects')->where('user_name', $username)->firstOrFail();
     } catch (ModelNotFoundException $e) {
         return Redirect::home();
     }
     // Take the Administrator to the admin panel.
     if ($user->id == '2') {
         return redirect('admin');
     }
     $contributions = Pledge::where('user_id', '=', $user->id)->get();
     $favourites = Favourite::with('project')->where('user_id', '=', $user->id)->get();
     // if it's a regular user, redirect to user's dashboard
     return view('userpanel.index', compact('user', 'contributions', 'favourites'));
 }
开发者ID:andreikainer,项目名称:kuj_abol,代码行数:23,代码来源:UserpanelController.php

示例15: destroy

 /**
  * Log a user out of larabook.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy()
 {
     Auth::logout();
     Flash::message('You have now been logged out.');
     return Redirect::home();
 }
开发者ID:itsSkyler,项目名称:larabook,代码行数:12,代码来源:SessionsController.php


注:本文中的Illuminate\Support\Facades\Redirect::home方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。