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

brainyprb's avatar

Laravel role based user management

I installed the following two Laravel packages:

Laravel Users https://github.com/jeremykenedy/laravel-users/

Laravel Roles https://github.com/jeremykenedy/laravel-roles

I want to build a hierarchical user management system. The system will have 4 different user roles:

  1. Super Admin
  2. Course Leader
  3. Teacher
  4. Student

Using the laravel-users package, the admin role is able to manage users from frontend. Similarly, I want to allow 2. Course Leader to manage all users below him (3. Teacher and 4. Student). And finally 3. Teacher should also be able to manage 4. Student

Above all, 1. Super Admin manages all.

How can I achieve this with above two laravel packages ? Is this something which can be achieved by the functionality already provided by these packages or do I need additional implementation ? I created these four roles using laravel-roles package but then could not implement the hierarchical user management as explained above.

0 likes
1 reply
alanholmes's avatar

@brainyprb

I have not used them packages, but have setup a roles/permissions similar using Spatie's package, but had to do it myself.

From what I have seen, these packages generally give you the ability to create/assign roles/permissions, but how you use them is up to you.

All of my actions are controlled by permissions, which are assigned to roles, but I have a 'role level' to indicate the level a user must be at to be able to assign a role/permissions to another user, so something similar to that could be used.

So, if you assigned a level to each of the roles, then you could say any users wholes maximum role <= Auth Users max role (if they can be assigned more than one role).

With my levels, I made sure to leave large gaps inbetween, in case any more levels needs to be added between

Please or to participate in this conversation.