Skip to content

3.12.0

Choose a tag to compare

@binaryk binaryk released this 15 Jul 16:46
· 70 commits to 3.x since this release

Added

  • Match by datetime
class PostRepository extends Repository
{
    public static $match = [
        'published_at' => RestifySearchable::MATCH_DATETIME,
    ];
}

Request:

GET: /restify-api/posts?published_at=2020-12-01
  • Match by array
class PostRepository extends Repository
{
    public static $match = [
        'published_at' => RestifySearchable::MATCH_ARRAY,
    ];
}

Request:

GET: /restify-api/posts?id=1,2,3

This will be converted to:

->whereIn('id', [1, 2, 3])
  • Negate a match
GET: /restify-api/posts?-id=1,2,3

This will return all posts where doesn't have the id in the [1,2,3] list.

You can apply - (negation) for every match:

GET: /restify-api/posts?-title="Some title"