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