Releases: BinarCode/laravel-restify
Releases · BinarCode/laravel-restify
4.3.0
4.2.0
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"
}4.1.1
Changed
- Changed the method signature of the
fromRelationandfromBuildermethods for the repository cast.
abstract public static function fromBuilder(RestifyRequest $request, Builder $builder, Repository $repository): Collection;
abstract public static function fromRelation(RestifyRequest $request, Relation $relation, Repository $repository): Collection;
4.1.0
Added
- Support for using a custom related cast class (aka transformer). You can do so by modifying the
restify.casts.relatedproperty. The default related cast isBinaryk\LaravelRestify\Repositories\Casts\RelatedCast.
The cast class should extends the Binaryk\LaravelRestify\Repositories\Casts\RepositoryCast abstract class.
Copy the default config to your restify.php configuration:
'casts' => [
/*
|--------------------------------------------------------------------------
| Casting the related entities format.
|--------------------------------------------------------------------------
|
*/
'related' => \Binaryk\LaravelRestify\Repositories\Casts\RelatedCast::class,
],
4.0.1
4.0.0
Added
- Available filters.
- Fields for relations.
- Security improvements.
- Mock data generator:
php artisan restify:stub users --count=10now support relations
And much much more, see official documentation.
3.18.0
3.17.0
Added
3.16.0
Added
Standalone actions
Sometimes you don't need to have an action with models. Let's say for example the authenticated user wants to disable his account. For this we have standalone actions:
// UserRepository
public function actions(RestifyRequest $request)
{
return [
DisableProfileAction::new()->standalone(),
];
}URI Key
Usually the URL for the action is make based on the action name. You can use your own URI key if you want:
class DisableProfileAction extends Action
{
public static $uriKey = 'disable_profile';
//...
}3.15.0
Added
mainQueryon repositories, now you can use this for show and index endpoints- Added
Binaryk\LaravelRestify\Models\CreationAwareinterface. Now you can extend it, and you will take the control over the model saving - now you can add a single entity to related