Published
- 1 min read
logout in laravel
The solution for this is noted below
logout in laravel
Solution
//route
Route::get('logout',[AuthController::class, 'logout'])->name('logout');
//logout function
use Auth,Session;
public function logout(){
Auth::logout();
Session::flush();
return redirect()->route('login');
}
<a href="{{ route('admin_logout') }}">Log Out </a>
Try other methods by searching on the site. That is if this doesn’t work