From 7bd425332ddf1efbe31792701274913a2f971c5f Mon Sep 17 00:00:00 2001 From: Brian Dillingham Date: Mon, 28 Dec 2020 18:17:32 -0500 Subject: [PATCH] Update readme.md --- readme.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/readme.md b/readme.md index 51d221f..73decef 100644 --- a/readme.md +++ b/readme.md @@ -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 @@ -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