Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

logout in laravel

//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>
 
PREVIOUS NEXT
Tagged: #logout #laravel
ADD COMMENT
Topic
Name
6+2 =