當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。