Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dillingham authored Dec 28, 2020
1 parent 130005c commit 7bd4253
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,6 @@ So you can filter which resources are able to be attached

You can add a method to the resource to be notified of the changes that have happened:

```php
public function permissionsSynced(array $changes)
{
$changes['attached']; // An array of IDs of attached models
$changes['detached']; // An array of IDs of detached models
$changes['updated']; // An array of IDs of updated models
}
```

The method must be a camel cased version of the attribute name, followed by `Synced`. For example:

```php
Expand All @@ -104,7 +95,14 @@ public function fields(Request $request)
}
```

Passes $changes to ``permissionsSynced` on the same resource.
```php
public function permissionsSynced(array $changes)
{
$changes['attached']; // An array of IDs of attached models
$changes['detached']; // An array of IDs of detached models
$changes['updated']; // An array of IDs of updated models
}
```


### Authorization
Expand Down

0 comments on commit 7bd4253

Please sign in to comment.