revati/laravel-soft-delete

Extend laravel core support for soft delete
21 4
Install
composer require revati/laravel-soft-delete
PHP:>=5.3.0
Last Updated:Feb 1, 2014
Links: GitHub  ·  Packagist
Maintainer: revati

This Laravel 4 package provides a additional routes for soft deletable resources:

  • route for restoring resource PUT/PATCH
  • route for force deleting resource DELETE (default delete used as soft delete)
  • route for trashed resources list GET

Installation

Begin by installing this package through Composer. Edit your project's composer.json file to require revati/laravel-soft-delete.

"require": {
    "laravel/framework": "4.1.*",
    "revati/laravel-soft-delete": "dev-master"
}

Next, update Composer from the Terminal:

composer update

Once this operation completes, the final step is to add the service provider. Open app/config/app.php, and add a new item to the providers array.

'Revati\SoftDelete\SoftDeleteServiceProvider'

That's it! You're all set to go.

Generated routes

Verb Path Action Route Name
Default routes
GET /resource index resource.index
GET /resource/create create resource.create
POST /resource store resource.store
GET /resource/{resource} show resource.show
GET /resource/{resource}/edit edit resource.edit
PUT/PATCH /resource/{resource} update resource.update
DELETE /resource/{resource} destroy resource.destroy
Additional routes
GET /resource/trash trash resource.trash
PUT/PATCH /resource/{resource}/restore restore resource.restore
GET /resource/{resource}/confirm restore resource.confirmDestroy
DELETE /resource/{resource}/force forceDestroy resource.forceDestroy

Related Packages

lord/laroute

Access Laravels URL/Route helper functions, from JavaScript.

2,008,759 789
eventix/cache

Provides caching methods which can be easily used for caching routes.

18,905 0
maartenstaa/laravel-41-route-caching

This package allows you to cache your routes definitions, thereby speeding up ea...

382,757 25
eventix/requestlog

Provides middleware to log full request and response to some storage instance.

2,339 0