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

itamelions's avatar

Laravel session timeout Redirect Users based on role.

I have 2 login routes in my laravel application. I'm trying to redirect the users on session timeout based on their roles (admin, user). if the role is admin redirect to admin login route, else redirect to user login route. how do I go about this?

currently, it's redirecting to the default laravel login for both roles.

0 likes
2 replies
Snapey's avatar
Snapey
Best Answer
Level 122

redirect when they try to access something that they need to be authenticated for?

How do you know what role they have until they login? Do you see the problem?

1 like

Please or to participate in this conversation.