zacksmash / laravel-softdelete-routes
恢复和删除资源操作
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
简介
此包为您提供了路由资源的一些辅助方法,用于处理模型的恢复和强制删除的额外操作。
// routes/web.php Route::resource('items', ItemController::class) ->softDeletes(); // Or individually, if you only need one Route::resource('items', ItemController::class) ->withRestore() ->withErase()
这将为您提供标准的路由资源方法,但您还将获得
# standard routes...
PATCH items/{item}/restore ..... items.restore › ItemController@restore
DELETE items/{item}/erase ......... items.erase › ItemController@erase