I have implemented laravel 5.2 multi authentication.I have two guard web(default)
and admin(created new)
. I have logged out user using Auth::logout()
but I am not able to logout admin. I tried to logout with Auth::guard('admin')->logout()
and Auth::guard('admin')->user()->logout()
. But its not working.
Try below code for logout method: App/Http/Controllers/LoginRegisterCtrl.php
public function logout()
{
Auth::guard('web')->logout();
Auth::guard('admin')->logout();
}
Above code should work for you.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.