File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -84,15 +84,6 @@ So you can filter which resources are able to be attached
8484
8585You 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-
9687The 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
You can’t perform that action at this time.
0 commit comments