Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

eggplantSword's avatar

Laravel 8 Logout returning The GET method is not supported for this route. Supported methods: POST.

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.

0 likes
5 replies
talel's avatar

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.

eggplantSword's avatar

I did check that but I was wondering why in Laravel 6 I could use <a> but not in Laravel 8

talel's avatar

Not quite sure to be honest. Haven’t code dive to find it, sure you can track it on the framework repository for Laravel 6.0. Let us know what you find.

franciscoarmando's avatar

I change from

 <form action="User/logout" method="post" class="inline">
                    @csrf
                    @method('POST')

to this

 <form action="{{route('User.logout')}}" method="post" class="inline">
                    @csrf
                    @method('POST')

and it works!

Please or to participate in this conversation.