Role Management
The Pro theme allows you to add user roles. By default, the theme comes with Admin, Creator and Member roles. To access the role management example click the “Laravel Examples/Role Management” link in the left sidebar or add /roles to the URL. Here you can add/edit new roles. To add a new role click the “Add role” button and to edit an existing role click the dotted menu (available on every table line) and then click “Edit”. In both cases, you will be directed to a form which allows you to modify the name and description of a role.
The policy which authorizes the user to access the role management option is implemented in App\Policies\RolePolicy.php.
You can find this functionality in App\Http\Livewire\Roles.php
.
Also, validation rules were added so you will know exactly what to input in the form fields. Note that these validation rules also apply for the role edit option.
public function render() {
return view('livewire.roles', [
roles' => Role::searchMultipleRoles($this->fields, $this->search)->orderBy($this->sortField, $this->sortDirection)->paginate($this->entries),
]);
}