zacksmash/laravel-softdelete-routes

Restore and Erase resource actions

v1.0.0 2024-08-29 23:06 UTC

This package is auto-updated.

Last update: 2024-10-29 23:25:34 UTC


README

Tests

Intro

This package gives you some helper methods on route resources to handle extra actions for restoring and force deleting a model.

// routes/web.php

Route::resource('items', ItemController::class)
    ->softDeletes();

// Or individually, if you only need one
Route::resource('items', ItemController::class)
    ->withRestore()
    ->withErase()

This will give you the standard route resource methods, but you'll also get:

# standard routes...
PATCH           items/{item}/restore ..... items.restore › ItemController@restore
DELETE          items/{item}/erase ......... items.erase › ItemController@erase