2017 © Pedro Peláez
 

library quicksand

Easily schedule regular cleanup of old soft-deleted Eloquent data.

image

tightenco/quicksand

Easily schedule regular cleanup of old soft-deleted Eloquent data.

  • Monday, April 16, 2018
  • by mattstauffer
  • Repository
  • 9 Watchers
  • 186 Stars
  • 30,904 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 17 Forks
  • 1 Open issues
  • 9 Versions
  • 12 % Grown

The README.md

Quicksand logo, (*1)

Quicksand

Tests, (*2)

Schedule a force delete of your soft deleted Eloquent models or pivot tables after they've been soft deleted for a given period of time., (*3)

Quicksand is an Artisan command that you can run in your scheduler daily., (*4)

Requirements

  • If you are using Laravel 5.6 or higher, use version 2.0 of this package.
  • If you are using Laravel 5.5 and running PHP 7.1 or higher, use version 1.0 of this package.
  • If you are using Laravel 5.4 or lower, or PHP 7.0 or lower, please use version 0.2 of this package.

Installation

  1. Add Quicksand to your Composer file: composer require tightenco/quicksand
  2. Register the Quicksand Service provider in config/app.php (you can skip this step if you're using Laravel 5.5 or higher due to package auto-discovery):, (*5)

    'providers' => [
        ...
    
        Tightenco\Quicksand\QuicksandServiceProvider::class,
    
  3. Publish your config: php artisan vendor:publish --provider="Tightenco\Quicksand\QuicksandServiceProvider"
  4. Edit your config. Define which classes and/or pivot tables you'd like to have Quicksand clean up for you, how many days Quicksand should wait to clean up, and whether or not the results should be logged. The default 'days' until cleaning up is overridable by specifying a 'days' key when registering a model or pivot table:, (*6)

    1. Note: Quicksand will disregard any global scopes applied to models when deleting.
    2. Note: Prior to version 2.3 the deletables configuration key was named models and did not support pivot tables.
    'days' => 30,
    
    'deletables' => [
        App\Default::class,
        App\CleanEveryTwentyDays::class => [
            'days'  => 20 // override default 'days'
        ],
        'example_pivot',
        'example_pivot' => [
            'days'  => 20 // override default 'days'
        ]
    ]
    
  5. Schedule the command in app/Console/Kernel.php:, (*7)

    protected function schedule(Schedule $schedule)
    {
        $schedule->command('quicksand:run')
            ->daily();
    }
    

Using a Custom Log File

If you are using Laravel 5.6 or higher, you can customize the logger Quicksand uses by adding a quicksand channel to your logging.php config file like so:, (*8)

'channels' => [
    /* ... */
    'quicksand' => [
        'driver' => 'single',
        'path' => storage_path('logs/quicksand.log'),
        'level' => 'info',
    ],
]

If you are using Laravel 5.5 or lower, you can customize the logger Quicksand uses by editing the custom_log_file option in your quicksand.php config file., (*9)

By default, Quicksand will log to the standard laravel.log file., (*10)

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository., (*11)

Authors

See also the list of contributors who participated in this project., (*12)

This package is developed and maintained by Tighten., (*13)

Testing

You can test this package by running, (*14)

composer test

License

This project is licensed under the MIT License - see the LICENSE.md file for details, (*15)

The Versions

16/04 2018

dev-js-cleanup

dev-js-cleanup https://github.com/tightenco/quicksand

Easily schedule regular cleanup of old soft-deleted Eloquent data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Benson Lee

13/04 2018

dev-master

9999999-dev

Easily schedule regular cleanup of old soft-deleted Eloquent data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Benson Lee

13/04 2018

v1.0.0

1.0.0.0

Easily schedule regular cleanup of old soft-deleted Eloquent data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Benson Lee

03/10 2017

v0.2.4

0.2.4.0

Easily schedule regular cleanup of old soft-deleted Eloquent data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Benson Lee

17/09 2017

v0.2.3

0.2.3.0

Easily schedule regular cleanup of old soft-deleted Eloquent data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Benson Lee

24/01 2017

v0.2.2

0.2.2.0

Easily schedule regular cleanup of old soft-deleted Eloquent data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Benson Lee

24/08 2016

v0.2.1

0.2.1.0

Easily schedule regular cleanup of old soft-deleted Eloquent data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Benson Lee

17/08 2016

v0.2

0.2.0.0

Easily schedule regular cleanup of old soft-deleted Eloquent data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Benson Lee

15/07 2016

v0.1

0.1.0.0

  Sources   Download

MIT

The Requires

 

by Benson Lee