PHP code example of falconsw / soft-delete-cleaner

1. Go to this page and download the library: Download falconsw/soft-delete-cleaner library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

falconsw / soft-delete-cleaner example snippets


'providers' => [
    // ...
    \FalconSW\SoftDeleteCleaner\SoftDeleteCleanerServiceProvider::class,
];

protected function schedule(Schedule $schedule)
{
    // ...
    $schedule->command(\FalconSW\SoftDeleteCleaner\SoftDeleteCleanerCommand::class)->hourly();
    // ...
}

class SampleModel extends Model
{
    use SoftDeletes;
    const SOFT_DELETE_CLEANER_STATUS = true;
}

const SOFT_DELETE_CLEANER_EXPIRE_TIME = '5 months';

class SampleModel extends Model
{
    use SoftDeletes;
    const SOFT_DELETE_CLEANER_STATUS = true;
    const SOFT_DELETE_CLEANER_EXPIRE_TIME = '5 months';
}
bash
php artisan vendor:publish --provider="FalconSW\SoftDeleteCleaner\SoftDeleteCleanerServiceProvider" --tag=config
bash
php artisan soft-delete:clean