# Role 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 `Roles Management` from the Laravel Examples section of the sidebar or adding `/role-management` in the url. This page is available for users with the Admin role and the user is able to edit and delete other users. If you would like to edit or delete an user you can click on the icon in the Action column. It is also possible to sort the fields or to change pagination.

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\Controllers\RoleController.php`` takes care of data validation, editing and removal of a the new role:

        public function update($id)
        {
            $this->authorize('manage-users', User::class);
            $role = Role::find($id);

            $attributes = request()->validate([
                'name' => ['required',  Rule::unique('roles')->ignore($role->id)],
                'description' => 'required'
            ]);

            $role->update($attributes);

            return redirect()->route('role-management')->with('succes', 'role succesfully updated');
        }