Delete
Usage
Call the specified endpoint and add in the body the specified entries you want to destroy:
// (DELETE) my-api.com/api/users
{
"resources": [5,6]
}
Response
As a response you'll receive the deleted records.
{
"data": [
{
"id": 1,
"name": "Evan Sauer"
}
],
"meta": {
"gates": {
"authorized_to_create": true
}
}
}
Soft Deletes
If you deal with softDeletes you should specify it first when registering the controller:
use \Lomkit\Rest\Facades\Rest;
Rest::resource('users', \App\Rest\Resources\UsersController::class)->withSoftDeletes()
Restore
Call the specified endpoint and add in the body the specified entries you want to restore:
// (POST) my-api.com/api/users/restore
{
"resources": [5,6]
}
Force Delete
Call the specified endpoint and add in the body the specified entries you want to force delete:
// (DELETE) my-api.com/api/users/force
{
"resources": [5,6]
}
Actions
Actions are a way to provide actions for your users with a full integration in Laravel Rest Api. It includes the strong search feature to enable security and power.
Basics
The primary feature of Laravel Rest Api is the ability to access and administrate your database records using Eloquent. Laravel Rest Api accomplishes this by allowing you to define a Rest "resource" that corresponds to each Eloquent model in your application.