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


PHP Auth::logout方法代碼示例

本文整理匯總了PHP中App\Http\Controllers\Auth\Auth::logout方法的典型用法代碼示例。如果您正苦於以下問題:PHP Auth::logout方法的具體用法?PHP Auth::logout怎麽用?PHP Auth::logout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在App\Http\Controllers\Auth\Auth的用法示例。


在下文中一共展示了Auth::logout方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getLogout

 /**
  * Log the user out of the application.
  *
  * @return \Illuminate\Http\Response
  */
 public function getLogout()
 {
     $user = \Auth::user()->name;
     \Auth::logout();
     \Session::flash('flash_message', $user . ': You have been logged out.');
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
開發者ID:dmorgorg,項目名稱:photos,代碼行數:12,代碼來源:AuthController.php

示例2: logout

 public function logout()
 {
     \Auth::logout();
     // logout user
     return \Redirect::to('admin/login');
     //redirect back to login
 }
開發者ID:devchd,項目名稱:metronic,代碼行數:7,代碼來源:AuthController.php

示例3: getLogout

 public function getLogout()
 {
     \Session::flush();
     \Cache::flush();
     \Auth::logout();
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
開發者ID:uusa35,項目名稱:abstractBackendApp,代碼行數:7,代碼來源:AuthController.php

示例4: getLogout

 public function getLogout()
 {
     \Auth::logout();
     \Session::flash('flash_message', 'You have been logged out');
     \Session::flash('flash_type', 'alert-info');
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
開發者ID:BrendanJohn,項目名稱:p4,代碼行數:7,代碼來源:AuthController.php

示例5: logout

 /**
  *  退出登錄
  */
 public function logout()
 {
     if (Auth::check()) {
         Auth::logout();
     }
     return Redirect::to('login');
 }
開發者ID:suhanyujie,項目名稱:digitalOceanVps,代碼行數:10,代碼來源:AuthController.php

示例6: getLogout

 /**
  * Log the user out of the application.
  *
  * @return \Illuminate\Http\Response
  */
 public function getLogout()
 {
     \Auth::logout();
     \Session::flash('flash_message', 'You are Logged Out.');
     return redirect('/');
     //return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
開發者ID:RafaelFlores,項目名稱:P4,代碼行數:12,代碼來源:AuthController.php

示例7: getLogout

 /**
  * Override the default getLogout method.
  * After logging out, unset/forget the jwt cookie.
  *
  * @return $this
  */
 public function getLogout()
 {
     //unset the cookie
     JWTService::unsetCookie();
     \Auth::logout();
     return redirect('/');
 }
開發者ID:scify,項目名稱:city-r-us-web,代碼行數:13,代碼來源:AuthController.php

示例8: getLogout

 /**
  * Overwrite the getLogout function in Illuminate\Foundation\Auth\AuthenticatesUsers;
  */
 public function getLogout()
 {
     \Auth::logout();
     \Session::forget('cart_merge');
     // custom feature
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/home');
 }
開發者ID:vincentgbs,項目名稱:mtgmarketplace,代碼行數:10,代碼來源:AuthController.php

示例9: logout

 /**
  * Display a login page
  *
  * @return \Illuminate\Http\Response
  */
 public function logout()
 {
     if (!\Auth::check()) {
         return redirect('/login');
     }
     \Auth::logout();
     return redirect('/login');
 }
開發者ID:hannahtinkler,項目名稱:too-tool-for-school,代碼行數:13,代碼來源:AuthController.php

示例10: logout

 public function logout(Request $request)
 {
     \Auth::logout();
     if ($request->wantsJson()) {
         return response()->json(['success' => true], 200);
     }
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
開發者ID:iramgutierrez,項目名稱:simple-cms-laravel-angularjs,代碼行數:8,代碼來源:AuthController.php

示例11: getLogout

 /**
  * Log the user out of the application.
  *
  * @return \Illuminate\Http\Response
  */
 public function getLogout()
 {
     // logout user
     \Auth::logout();
     // indicate user is logged out
     \Session::flash('flash_message', 'You have been logged out.');
     // delete all data from the global session
     \Session::flush();
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
開發者ID:jasonjyu,項目名稱:cscie15-p4,代碼行數:15,代碼來源:AuthController.php

示例12: postLogin

 public function postLogin(Request $request)
 {
     $this->validate($request, ['email' => 'required|email', 'password' => 'required']);
     $credentials = $request->only('email', 'password');
     if ($this->auth->attempt($credentials, $request->has('remember'))) {
         $user = \Auth::user();
         if ($user->accessible == 0) {
             \Auth::logout();
             return redirect()->back()->withErrors(['Your Account has been blocked']);
         } else {
             return redirect()->intended($this->redirectPath());
         }
     }
     return redirect($this->loginPath())->withInput($request->only('email', 'remember'))->withErrors(['email' => $this->getFailedLoginMessage()]);
 }
開發者ID:akritisehrawat,項目名稱:talentscool2016,代碼行數:15,代碼來源:AuthController.php

示例13: logout

 /**
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function logout()
 {
     \Auth::logout();
     return redirect('/');
 }
開發者ID:nvisser,項目名稱:sportschool,代碼行數:8,代碼來源:AuthController.php

示例14: getLogout

 public function getLogout()
 {
     \Session::flash('flash_message', 'Thank You for Stopping By. We Look Forward To The Next Time!');
     \Auth::logout();
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
開發者ID:jpedroza,項目名稱:p4j.aacax.net,代碼行數:6,代碼來源:AuthController.php

示例15: getLogout

 /**
  * Log the user out of the application.
  *
  * @return \Illuminate\Http\Response
  */
 public function getLogout()
 {
     \Auth::logout();
     flash()->success('Logout successful');
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
開發者ID:psiskova,項目名稱:blog-academy,代碼行數:11,代碼來源:AuthController.php


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