本文整理匯總了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 : '/');
}