You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can define a policy method `syncPermissions`. The name should start with `sync` and suffix with the plural `CamelCase` name of the model's relationship name:
648
+
649
+
```php
650
+
// RolePolicy.php
651
+
652
+
public function syncPermissions(User $authenticatedUser, Company $company, Collection $keys): bool
653
+
{
654
+
// $keys are the primary keys of the related model (permissions in our case) Restify is trying to `sync`
655
+
}
656
+
```
657
+
621
658
### Detach related
622
659
623
660
As soon we declared the `BelongsToMany` relationship, Restify automatically registers the `detach` endpoint:
0 commit comments