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

shanely's avatar

Roles need help

Hi, can I ask does laravel can do the same like the sentinel https://cartalyst.com/manual/sentinel/2.0 , that can manage the access rights ? how can I use roles in laravel. like for example I want only to give minimum rights to "STAFF" that can only perform the CREATE or adding customers in the system ?I want to do like this in laravel but I have no idea how to get started.

Thank you in advance.

0 likes
2 replies
stevenobird's avatar

Hi,

for this type of access you can go with a role column in the users table and a roles table which contains the rights. You could also put your rights directly into the users table, that is of course up to you.

Now that you have your rights saved in the database, you can make use of Authorization - which can be achieved by the Gate Facade for example. https://laravel.com/docs/master/authorization

If you want to seperate your auth logic from the controller, you can define policies, which you can learn about in the link I posted - it works the exact way that you want it to be: You can decide which role can create, update, delete, ...

shanely's avatar

Ok thank you I will try, is there a tutorial like what you said ?

Please or to participate in this conversation.