You can nudge your life in a new direction every day.

Creating a logout link using a GET request in Laravel 8 & Fortify

Submitted by admin on Thu, 05/20/2021 - 15:24

If you are using Fortify you have probably noticed the only way out of the box to invoke a logout is via a POST request


I still need to optimize this a bit but you can call the same Fortify Controller method via the route.


Route::get('/logout', 'Laravel\Fortify\Http\Controllers\AuthenticatedSessionController@destroy');