Skip to content

Commit 642f10d

Browse files
authored
Update README.md
1 parent 8870fec commit 642f10d

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,27 @@ php artisan vendor:publish --tag="access-tree-config"
2626

2727
## Usage
2828

29-
#Create a Permission or Role
29+
Create a Permission
3030
```php
3131
$data = [
32-
'data_id' => 5,
33-
'name' => 'See Auth',
34-
'status' => 1
32+
'name' => 'Add User',
33+
'status' => 1 or 0
3534
];
3635
$create = createAccess($data, 'permission');
3736
echo $create;
3837
```
3938

39+
Create a Role
40+
```php
41+
$data = [
42+
'name' => 'Admin',
43+
'status' => 1 or 0
44+
];
45+
$permission_ids = [1, 5, 4];
46+
$create = createAccess($data, 'role', $permission_ids);
47+
echo $create;
48+
```
49+
4050
## Changelog
4151

4252
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

0 commit comments

Comments
 (0)