You can use the guest middleware on the public routes.
Oct 10, 2024
8
Level 1
Is there a way to protect my global routes in laravel?
I have two different user roles ( admin, sales-admin) I have created a middleware for each of them to see different views, and it works perfectly. on the other hand, I have some public routes everyone can access them
how it's working now:when I login as sales-admin I can see my views + global routes as a logged sales user
what I want is: when I login as sales-admin be able to see my views (www.mywebsite.com.salesadmin) and + if sales-admin hits a public URL like(www.mywebsite.com) make them logout then be able to see the public routes
Please or to participate in this conversation.