The logout route is expecting a post request, which you send with Inertia but not with the anchor tag.
You can check it with
php artisan route:list -name=logout
to see the associated request methods and controller to that end point.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm facing this issue when trying to logout, I'm doing a simple <a> when getting this error
<a href="/logout">
<button>Logout</button>
</a>
It works when I do this (Vue + Inertia.js) using an Inertia.js request
<el-button @click="logout">Logout</el-button>
//method
logout() {
this.$inertia.post('/logout');
}
Why doesn't the first way work? It used to work with an <a> in Laravel 6.
Please or to participate in this conversation.