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

lara07's avatar
Level 1

login laravel

Hello Why in Laravel, when we log in, the user who logs in is OK But when I try to get the root login, it redirects me to the main page It means that it does not allow the user to see the register and login routes when he logs in. Thanks ..

0 likes
2 replies
Snapey's avatar

because you must logout before trying to register or login.

1 like
Ben Taylor's avatar

The authentication routes use the auth and guest middleware where appropriate. You might want to look up the documentation regarding middleware to learn more about it.

You can always remove the middleware from the routes to allow logged in users to access the login and register pages, but why the heck would you want to do that?

1 like

Please or to participate in this conversation.