Laravel logout
//make a route as a post
Route::post("/logout",[LogoutController::class,"store"])->name("logout");
//and make a form in your template or what ever you frontend client..
<form action="{{ route('logout') }}" method="post">
@csrf
<button type="submit">Logout</button>
</form>
//Controller will be like this.
public function store(Request $request) {
auth()->logout();
return redirect()->route('login');
}
Azizul7m