Skip to content

Releases: BinarCode/laravel-restify

7.7.2

13 Jan 11:28
d76fb58
Compare
Choose a tag to compare

Fixed

  • Profile request class

7.7.1

22 Nov 12:41
18d120a
Compare
Choose a tag to compare

Fixed

  • Remove Email Exist validation #518

7.7.0

17 Sep 14:30
d0cff08
Compare
Choose a tag to compare

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

16 Sep 21:07
Compare
Choose a tag to compare

Fixed

  • The rest method will consider the meta information for the rest helper: rest($user)->indexMeta(['token' => $token])

7.6.2

15 Sep 09:40
Compare
Choose a tag to compare

Fixed

  • Belongs search with custom foreign key #512

Inherited https://github.com/BinarCode/laravel-restify/releases/tag/6.12.2

7.6.1

15 Sep 09:32
Compare
Choose a tag to compare

Added

  • Serializer - Serialize One model or nothing using the show response format #510

Fixed

  • Listing routes in console #514

7.6.0

15 Sep 09:20
7850bab
Compare
Choose a tag to compare

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 and getters).

6.12.2

15 Sep 08:51
93979c5
Compare
Choose a tag to compare

Fixed

  • Belongs search with custom foreign key #512

7.5.4

02 Aug 10:29
752e1ed
Compare
Choose a tag to compare

Fixed

  • The unauthorized code should be 401.

7.5.3

01 Aug 12:43
dae2293
Compare
Choose a tag to compare

Refactored

  • The testing Repository::route( method has a new signature, it accepts the action as well now.