Support the ongoing development of →
Last updated 2 years ago.

Take a look at these too packages:

Both packages support user management including roles and you can assign them very easily, it's all in the documentation!

Last updated 2 years ago.

I am using Zizaco/entrust

After assigned a multiple roles for a single user. Table assigned_role

id user role_id 1 1 1 2 1 2 3 1 3 etc.,

Now I have the following code in login controller

 // Assign a Role to user 
            foreach (Auth::User()->roles as $key => $role) {
                $role_id = $role['role_id'];
            Session::put('user_role', $role_id);

in layout menu show /hide purpose I am using

// some links

when I logged in as Role 2 it doesn't have user access but still it displays the user menu for user role 2

I am not sure what I did wrong ?

Last updated 2 years ago.

Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.