Skip to content

4.2.0

Compare
Choose a tag to compare
@binaryk binaryk released this 16 Dec 15:04
· 98 commits to 4.x since this release
843e13f

Added

Match definition

You can implement a match filter definition, and specify for example related repository:

  public static $match = [
        'title' => 'string',
        'user_id' => MatchFilter::make()
            ->setType('int')
            ->setRelatedRepositoryKey(UserRepository::uriKey()),
];

When you will list this filter (with posts/filters?only=matches), you will get:

  {
      "class": "Binaryk\LaravelRestify\Filters\MatchFilter"
      "key": "matches"
      "type": "string"
      "column": "title"
      "options": []
    },
    {
      "class": "Binaryk\LaravelRestify\Filters\MatchFilter"
      "key": "matches"
      "type": "int"
      "column": "user_id"
      "options": []
      "related_repository_key": "users"
      "related_repository_url": "//users"
    }