Looking to hire Laravel developers? Try LaraJobs

laravel-softdelete-routes maintained by zacksmash

Description
Restore and Erase resource actions
Author
Last update
2025/04/28 05:13 (dev-main)
License
Downloads
838

Comments
comments powered by Disqus

Laravel Soft Delete Routes

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