Releases: BinarCode/laravel-restify
Releases · BinarCode/laravel-restify
7.7.2
7.7.1
7.7.0
Sync related
You can also sync
your BelongsToMany
field. Say you have to sync permissions to a role. You can do it like this:
POST: api/restify/roles/1/sync/permissions
Payload:
{
"permissions": [1, 2]
}
Under the hood this will call the sync
method on the BelongsToMany
relationship:
// $role of the id 1
$role->permissions()->sync($request->input('permissions'));
Authorize sync
You can define a policy method syncPermissions
. The name should start with sync
and suffix with the plural CamelCase
name of the model's relationship name:
// RolePolicy.php
public function syncPermissions(User $authenticatedUser, Company $company, Collection $keys): bool
{
// $keys are the primary keys of the related model (permissions in our case) Restify is trying to `sync`
}
7.6.3
7.6.2
7.6.1
7.6.0
Added
- The
policyMeta
method is now protected at the repository level (it could be used to override the policy information for the show and index methods. - Do not make
RelatedDto
as a singleton in a test environment (this causes issues when trying to make few relationship requests to the same repository in the same test)
Fixed
- Always public index method if no policy
- Unit test that shows routes list command.
- Fix Gate::check - show - not working
Support
- Added unit tests for the testing helpers (
action
,route
andgetters
).