Skip to content

Commit aa4f83d

Browse files
authored
Merge pull request #2235 from xorinzor/patch-1
[Docs] Add syncPermissions() in role-permissions.md
2 parents 2ec9bef + 61692e9 commit aa4f83d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/basic-usage/role-permissions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ A permission can be revoked from a role:
8484
$role->revokePermissionTo('edit articles');
8585
```
8686

87+
Or revoke & add new permissions in one go:
88+
89+
```php
90+
$role->syncPermissions(['edit articles', 'delete articles']);
91+
```
92+
8793
The `givePermissionTo` and `revokePermissionTo` functions can accept a
8894
string or a `Spatie\Permission\Models\Permission` object.
8995

0 commit comments

Comments
 (0)