Skip to content
Advertisement

Laravel – Auth installed but logout route not found

I made a laravel system and included the Auth scaffolding stated in the documentation. I installed it by using

JavaScript

And running npm install and npm run dev to compile the assets. But for some weird reason the /logout route returns a 404. My routes look like this

JavaScript

I don’t know where to look. How can I fix this?

Advertisement

Answer

If you take a look at vendor/laravel/framework/src/Illuminate/Routing/Router.php you will see this piece of code:

JavaScript

Which means that no GET route is defined for logout, only POST. That’s why you are getting a 404 response. You can add one GET route by yourself with custom page, if you need, something like:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement