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


PHP Auth::guard方法代码示例

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


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

示例1: register

 /**
  * Handle a registration request for the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function register(Request $request)
 {
     $validator = $this->validator($request->all());
     if ($validator->fails()) {
         return redirect(action('Auth\\AuthController@showRegistrationForm'))->withErrors($validator)->withInput();
     }
     \Auth::guard($this->getGuard())->login($this->create($request->all()));
     return redirect($this->redirectPath());
 }
开发者ID:emeyer161,项目名称:TheThirstyTerp,代码行数:15,代码来源:AuthController.php

示例2: handleUserWasAuthenticated

 /**
  * Send the response after the user was authenticated.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  bool  $throttles
  * @return \Illuminate\Http\Response
  */
 protected function handleUserWasAuthenticated(Request $request, $throttles)
 {
     if ($throttles) {
         $this->clearLoginAttempts($request);
     }
     if (method_exists($this, 'authenticated')) {
         return $this->authenticated($request, Auth::guard($this->getGuard())->user());
     }
     flash()->success('Welcome!', '');
     return redirect()->intended($this->redirectPath());
 }
开发者ID:goatatwork,项目名称:access2,代码行数:18,代码来源:AuthController.php

示例3: register

 /**
  * Handle a registration request for the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function register(Request $request)
 {
     $validator = $this->validator($request->all());
     if ($validator->fails()) {
         $this->throwValidationException($request, $validator);
     }
     $this->create($request->all());
     if (!\Auth::user()) {
         \Auth::guard($this->getGuard())->login($this->create($request->all()));
         return redirect($this->redirectPath());
     } else {
         return redirect()->action('Auth\\UserController@getIndex')->with('message_type', 'success')->with('message', 'Successfully created! Edit them to add to groups!');
     }
 }
开发者ID:prkeshri,项目名称:getpanel,代码行数:20,代码来源:AuthController.php

示例4: logout

 /**
  * Log the user out of the application.
  *
  * @return \Illuminate\Http\Response
  */
 public function logout()
 {
     \Auth::guard($this->getGuard())->logout();
     \Session::flash('message', 'You have been logged out.');
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
开发者ID:nsaludo,项目名称:p4,代码行数:11,代码来源:AuthController.php

示例5: resetPassword

 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $user->password = $password;
     $user->save();
     Auth::guard($this->getGuard())->login($user);
 }
开发者ID:mmonbr,项目名称:20Pavos,代码行数:13,代码来源:PasswordController.php


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