本文整理汇总了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 : '/');
}
示例2: logout
public function logout()
{
\Auth::logout();
// logout user
return \Redirect::to('admin/login');
//redirect back to login
}
示例3: getLogout
public function getLogout()
{
\Session::flush();
\Cache::flush();
\Auth::logout();
return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
}
示例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 : '/');
}
示例5: logout
/**
* 退出登录
*/
public function logout()
{
if (Auth::check()) {
Auth::logout();
}
return Redirect::to('login');
}
示例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 : '/');
}
示例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('/');
}
示例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');
}
示例9: logout
/**
* Display a login page
*
* @return \Illuminate\Http\Response
*/
public function logout()
{
if (!\Auth::check()) {
return redirect('/login');
}
\Auth::logout();
return redirect('/login');
}
示例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 : '/');
}
示例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 : '/');
}
示例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()]);
}
示例13: logout
/**
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function logout()
{
\Auth::logout();
return redirect('/');
}
示例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 : '/');
}
示例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 : '/');
}