Skip to content

Commit

Permalink
Update roles-and-permissions.md (#660)
Browse files Browse the repository at this point in the history
* Update roles-and-permissions.md

Clarification of the requirements for the use of roles and permissions

* Update roles-and-permissions.md
  • Loading branch information
avelco authored Jan 23, 2024
1 parent c95c520 commit cfaf84d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/docs/8.x/usage/roles-and-permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ sidebarDepth: 2

Let's start by creating the following `Role`s:

By default, the paths for the Role and Permission models will be `App\Models\Role` and `App\Models\Permission`. If you want to modify them, you can go to `config/laratrust.php`.

```php
use App\Models\Role;

$owner = Role::create([
'name' => 'owner',
'display_name' => 'Project Owner', // optional
Expand All @@ -25,6 +29,8 @@ $admin = Role::create([
Now we need to add `Permission`s:

```php
use App\Models\Permission;

$createPost = Permission::create([
'name' => 'create-post',
'display_name' => 'Create Posts', // optional
Expand Down

0 comments on commit cfaf84d

Please sign in to comment.