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

alturic's avatar

Roles and(?) Permissions...

Hey guys, I'm trying to pick up Laravel and I'm curious how to implement what I'll deem Roles AND permissions. So let's say we have Administrators, and we want to (for lack of a better word) "fine-tune" a specific Administrators permissions. The "role" would be Administrator, but John should be able to access everything, while Abraham should only be able to access certain Administrator permissions. While the case could be made that they would then be different Roles... I can't seem to get behind that.

Perhaps here's a better example. We have a Sales Manager, we have a view for different regions. John should only be able to see the Northeast region, while our other Sales Manager Abraham, he should only see the Southwest Region. They are both Sales Managers, but for different regions. So in essence, I'm envisioning drilling into the User and setting their role and what region they belong to, keeping in mind Abraham could be filling in for John so a User can hasMany "regions"/permissions.

Is this possible with Laravel's (5.5) Auth system or would these types of fine-tuning require external packages?

If I've confused the heck out of you, the second paragraph is an exact example of what I'm looking to do.

0 likes
3 replies
aleksandar96's avatar

Yes, it is possible.

First option is to build this system by yourself. From what you have described, you will need specific permission for every type of role so for example:

role: manager permissions: edit Notheast region, edit Southwest region etc.

Second option is to go with existing package. I would recommend: https://github.com/spatie/laravel-permission

Good luck in finding best solution!

Please or to participate in this conversation.