# Delete

> Laravel Rest Api exposes endpoints to manage entries' lifecycles. Here is how to consume them.

## Usage

Call the specified endpoint and add in the body the specified entries you want to destroy:

```json
// (DELETE) my-api.com/api/users
{
    "resources": [5,6]
}
```

## Response

As a response you'll receive the deleted records.

```json
{
  "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:

```php [api.php]
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:

```json
// (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:

```json
// (DELETE) my-api.com/api/users/force
{
    "resources": [5,6]
}
```
