PHP code example of pachristos / filament-export-cleanup

1. Go to this page and download the library: Download pachristos/filament-export-cleanup 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/ */

    

pachristos / filament-export-cleanup example snippets


use Pachristos\FilamentExportCleanup\FilamentExportCleanup;

$deletedIds = app(FilamentExportCleanup::class)->run();

use FilamentExportCleanup;

$deletedIds = FilamentExportCleanup::run();

use Illuminate\Console\Scheduling\Event;

'schedule' => [
    'enabled' => env('FILAMENT_EXPORT_CLEANUP_SCHEDULE_ENABLED', true),
    'frequency' => fn (Event $event) => $event
        ->weekdays()
        ->dailyAt('02:00'),
],

'frequency' => fn (Event $event) => $event->hourly(),

'frequency' => fn (Event $event) => $event
    ->twiceDaily(1, 13)
    ->timezone('Europe/Athens'),

'frequency' => fn (Event $event) => $event
    ->weeklyOn(0, '03:00'),

'frequency' => '0 3 * * 0',
bash
php artisan vendor:publish --tag="filament-export-cleanup-config"
bash
php artisan filament-export-cleanup:install
bash
php artisan cleanup:filament-export