laravel-restify

The fastest way to make a powerful JSON:API compatible Rest API with Laravel.

MIT License

Downloads
321.1K
Stars
600
Committers
20

Bot releases are hidden (Show)

laravel-restify - 5.1.2

Published by binaryk over 3 years ago

Added

  • Make sure Advanced Filters are picked up #399
laravel-restify - 5.1.1

Published by binaryk over 3 years ago

Added

  • key for simple filters
laravel-restify - 5.1.0

Published by binaryk over 3 years ago

Fixed

  • Custom routes definition

Added

  • patch verb will now validate / authorize and update by attribute
  • All filters now have title, description and column so you can easily customize it. The full definition of an AdvancedFilter's looks like:

array:8 [
  "type" => "multiselect"
  "advanced" => true
  "title" => "Status filter"
  "description" => "Short description"
  "column" => "status"
  "key" => "status-filter"
  "rules" => array:1 [
    "status" => array:1 [
      0 => "required"
    ]
  ]
  "options" => array:1 [
    0 => array:2 [
      "label" => "Draft"
      "property" => "draft"
    ]
  ]
]
  • Added new filters type Binaryk\LaravelRestify\Filters\MultiSelectFilter
laravel-restify - 5.0.2

Published by binaryk over 3 years ago

Added

  • data helper typehint
laravel-restify - 5.0.1

Published by binaryk over 3 years ago

Fixed

  • Routes finding.
  • data helper now accept status.
laravel-restify - 5.0.0

Published by binaryk over 3 years ago

Added

  • Added PHP8 refactoring, type definitions.
  • Filters were improved, so now we have AdvancedFilter.
  • Related now doesn't require 3 parameters.
  • Support for json:api filtering https://jsonapi.org/recommendations/#filtering
  • Many other improvements, see Upgrading documentation.
laravel-restify - 4.12.4

Published by binaryk over 3 years ago

Added

  • filters link to the index links list
laravel-restify - 4.12.3

Published by binaryk over 3 years ago

Fixed

  • Related when null, should not use Builder.
laravel-restify - 4.12.1

Published by binaryk over 3 years ago

Added

  • Partial match:
    public static function matches(): array
    {
        return [
            'name' => MatchFilter::make()
                ->setType(RestifySearchable::MATCH_TEXT)
                ->partial(),
            'code' => MatchFilter::make()
                ->setType(RestifySearchable::MATCH_TEXT)
                ->strict(),

So now if your frontend will call:

/users?name=Johnthe search will return back even users with a name like: John Doe

If you are using ->strict() modifier, which is by default for all matches, then the API will search only for the name John.

laravel-restify - 4.12.0

Published by binaryk over 3 years ago

Added

  • Search by a belongs to column:
// PostRepository

related() {
             'user' => BelongsTo::make('user', 'user', UserRepository::class)->searchable([
                'users.name'
            ])
}

So now your search will consider the users.name as well in a orWhere query:

?search=John Doe this will return you back all your posts where the belongs to user name has %John Doe%

Fixed

  • Sorting by a belongs to column fixed. Before it was working only for the name column, now it's dynamical.
laravel-restify - 4.11.0

Published by binaryk over 3 years ago

Added

  • Now you can use a closure for the related:

related() : array
{
  return [ 'owner' => fn() => 'John Doe'; ];
}

laravel-restify - 4.10.5

Published by binaryk over 3 years ago

Fixed

  • Image field now can use the ->default('image.png'), so if the image is not on the disk, it will fallback into it.
laravel-restify - 4.10.4

Published by binaryk over 3 years ago

Added

  • Authorization configuration for the restifyjs.
laravel-restify - 4.10.3

Published by binaryk over 3 years ago

Added

  • Filtering by datetimeinterval:
// Repository: 
$match = [
            'created_at' => RestifySearchable::MATCH_DATETIME_INTERVAL,
];

Query:

// Use isoString format

GET: /posts?created_at=created_at=2020-12-16T09:48:52.480645Z,2021-02-16T09:48:52.481004Z

This will filter by this interval.

You can also negate this by using - before the column name: -created_at=.

laravel-restify - 4.10.2

Published by binaryk over 3 years ago

Fixed

  • Sorting using BelongsTo field type. So now you can have:
// PostRepository

public static function sorts(): array
{
  return [
            'users.attributes.name' => SortableFilter::make()->setColumn('users.name')->usingBelongsTo(
                BelongsTo::make('user', 'user', UserRepository::class),
            )
 ];
}

And frontend can filter your posts by users.name using:

api/restify/posts?sort=users.attributes.name.

laravel-restify - 4.10.1

Published by binaryk over 3 years ago

Fixed

  • Fixed the php artisan restify:setup command issue with the config publishing.
laravel-restify - 4.10.0

Published by binaryk almost 4 years ago

Added

  • For the BelongsToMany, MorphToMany fields now you can specify validations rules using:
BelongsToMany::make('roles', 'roles', RolesRepository::class)->validationCallback(fn(Request $request) => ....))
  • Added ->unique() to BelongsToMany kind fields, so you can validate unicity of your pivot table entries.
  • Fixed $withs property for repositories when force eager loading.
laravel-restify - 4.9.2

Published by binaryk almost 4 years ago

Added

  • Model guesser, so if you have ArticleRepository for example, Restify will guess the model App\Models\Article so you don't have to define the model static property.
laravel-restify - 4.9.1

Published by binaryk almost 4 years ago

Added

  • data helper
laravel-restify - 4.9.0

Published by binaryk almost 4 years ago

Added

  • PHP 8.0 Support.
Package Rankings
Top 6.09% on Packagist.org
Related Projects