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
84
84
85
85
You can add a method to the resource to be notified of the changes that have happened:
86
86
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
-
96
87
The method must be a camel cased version of the attribute name, followed by ` Synced ` . For example:
97
88
98
89
``` php
@@ -104,7 +95,14 @@ public function fields(Request $request)
104
95
}
105
96
```
106
97
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
+ ```
108
106
109
107
110
108
### Authorization
You can’t perform that action at this time.
0 commit comments