zacksmash / laravel-softdelete-routes
Restore and Erase resource actions
v1.0.0
2024-08-29 23:06 UTC
Requires
- php: ^8.2
- illuminate/contracts: ^10.0||^11.0
- illuminate/routing: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.14
- orchestra/testbench: ^9.3
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
README
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