edofre/laravel-softdelete-cleanup

Console command to cleanup your database from softdeleted models

V1.2.0 2017-05-29 21:05 UTC

README

Latest Stable Version Total Downloads Latest Unstable Version License composer.lock Build Status Code Climate Build Status

Installation

The preferred way to install this extension is through composer.

To install, either run

$ php composer.phar require edofre/laravel-softdelete-cleanup

or add

"edofre/laravel-softdelete-cleanup": "V1.2.0"

to the require section of your composer.json file.

Configuration

Add the console command to the $commands array in your /app/Console/Kernel.php

protected $commands = [
        \Edofre\SoftdeleteCleanup\SoftdeleteCleanup::class,
    ];

Executing

The following command will then remove all the trashed items from the User, note that the User model is not in the default namespace.

php artisan db:softdelete-cleanup App\\Models\\User

Tests

Run the tests by executing the following command:

composer test

Feature requests

  • Set the number of days from which the items should be deleted
  • ?