The fastest way to make a powerful JSON:API compatible Rest API with Laravel.
MIT License
Bot releases are hidden (Show)
Published by binaryk about 2 years ago
restifyAuth
macro works.Published by binaryk about 2 years ago
RestifyServiceProvider
in the local repository so the dev will have control over that.Published by binaryk about 2 years ago
Published by binaryk about 2 years ago
Published by binaryk about 2 years ago
Published by binaryk about 2 years ago
ActionLog::register("project marked active by user Auth::id()", $project->id)
)$with
loads relationship in show
requestsPostRepository::withModels(Post::query()->take(5)->get())->include('user')->serializeForShow()
- see seralizer()
api/restify/company/include=users.posts[id, name].comments[title]
)a.b.c.d
)HasMany::make('posts')
see Change Log and Upgrading guideline
Published by binaryk over 2 years ago
Published by binaryk over 2 years ago
Published by binaryk over 2 years ago
Published by binaryk over 2 years ago
setTitle
for filters so the FE could display thempublic static function matches(): array
{
return [
'invoice_id' => MatchFilter::make()
->setType('array')
->setTitle('Job Number')
->setRelatedRepositoryKey(InvoiceRepository::uriKey()),
];
}
Published by binaryk over 2 years ago
The payload for a bulk delete should contain an array of primary keys for the models you want to delete:
[
1, 10, 15
]
These models will be resolved from the database and check for the deleteBulk
policy permission, in case any of the models isn't allowed to be deleted, no entry will be deleted.
Published by binaryk over 2 years ago
Published by binaryk over 2 years ago
Published by binaryk over 2 years ago
Published by binaryk over 2 years ago
BelongsTo
and BelongsToMany
and MorphMany
relationshipsPublished by binaryk over 2 years ago
has
filesystem on null.Published by binaryk over 2 years ago
Published by binaryk over 2 years ago
Sometimes you might want to load specific columns from the database into the response. For example, if you have a Post
model with an id
, title
and a description
column, you might want to load only the title
and the description
column in the response.
In order to do this, you can use in the request:
GET /users/1?include=posts[title|description]
Published by binaryk over 2 years ago
Published by binaryk over 2 years ago
By default, Restify search is case-sensitive. You can change this behavior by changing the configuration:
// restify.php
'search' => [
/*
| Specify either the search should be case-sensitive or not.
*/
'case_sensitive' => false,
],