Logout should always be a POST method. Why did you change it if you used Jetstream ?
anyway
return redirect(route('login')->with('success', 'Logged Out');
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am now trying to create the log out button and this error pops up. I already spent some time on it and it is still not resolved. Please suggest to me what to do to solve this. Thanks. (FYI: I have installed the Jetstream for authentication)
Codes from Blade button
<li class="dropdown-footer">
<a href="{{ route('user.logout') }}"> <i class="mdi mdi-logout"></i> Log Out </a>
</li>
Codes from Route
Route::get('/user/logout', [UserController::class, 'logout'])->with('user.logout');
Codes from Controller
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class UserController extends Controller
{
public function __construct() {
$this->middleware(['auth']);
}
public function logout() {
Auth::logout();
return redirect()->route('login')->with('success', 'Logged Out');
}
}
Please or to participate in this conversation.