Skip to content

Commit 7bd4253

Browse files
authored
Update readme.md
1 parent 130005c commit 7bd4253

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

readme.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,6 @@ So you can filter which resources are able to be attached
8484

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

87-
```php
88-
public function permissionsSynced(array $changes)
89-
{
90-
$changes['attached']; // An array of IDs of attached models
91-
$changes['detached']; // An array of IDs of detached models
92-
$changes['updated']; // An array of IDs of updated models
93-
}
94-
```
95-
9687
The method must be a camel cased version of the attribute name, followed by `Synced`. For example:
9788

9889
```php
@@ -104,7 +95,14 @@ public function fields(Request $request)
10495
}
10596
```
10697

107-
Passes $changes to ``permissionsSynced` on the same resource.
98+
```php
99+
public function permissionsSynced(array $changes)
100+
{
101+
$changes['attached']; // An array of IDs of attached models
102+
$changes['detached']; // An array of IDs of detached models
103+
$changes['updated']; // An array of IDs of updated models
104+
}
105+
```
108106

109107

110108
### Authorization

0 commit comments

Comments
 (0)