Roles Management

The Admin user has access to a roles management table page.


The PRO version lets you add roles to the user. The default roles are Admin, Creator and Member. The user management can be accessed by clicking Role Management from the Laravel Examples section of the sidebar. This page is available for users with the Admin role and the user is able to add, edit and delete other users. For adding a new role you can press the + Add Role button. If you would like to edit or delete an user you can click on the Action column. It is also possible to sort the fields or to search in the fields.

On the page for adding a new role you will find a form which allows you to fill the name and the description of the new role.

The App/Http/Livewire/LaravelExamples/Roles/Create.php takes care of data validation and creation of a the new role:

              
                public function store(){

                    $this->validate();

                    Role::create([
                        'name' => $this->name,
                        'description' => $this->description
                    ]);

                    return redirect(route('role-management'))->with('status','Role successfully created.');
                }
              
              

The policy which authorizes the user to access the role management option is implemented in App\Policies\RolePolicy.php .