Suggest you use authentication for login and use authorization to determine who can do what with their role.
Many good past discussions on this setup.
You do not need it in the url, I wouldn't.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello
i am making an app for practice with multiple roles admin supervisor, employer.
I am Struggling to decide weather to include the user role in the URL of each user's dashboard or render the view based on the role of the user while not including it in the URL. Is there A good recommended approach to solve this. All of my dashboards have the same layout which only different in the amount of options in the sidebar per role.
case-1: 'admin/employeer/1/edit'
case-2 : 'employer/employeer/1/edit'
what will be good?
Suggest you use authentication for login and use authorization to determine who can do what with their role.
Many good past discussions on this setup.
You do not need it in the url, I wouldn't.
Please or to participate in this conversation.