17 lines
602 B
PHP
17 lines
602 B
PHP
<?php
|
|
|
|
use Illuminate\Foundation\Inspiring;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
use App\Uploads\Services\CleanupService;
|
|
|
|
Artisan::command('inspire', function () {
|
|
$this->comment(Inspiring::quote());
|
|
})->purpose('Display an inspiring quote');
|
|
|
|
Artisan::command('uploads:cleanup {--limit=100 : Maximum drafts to clean in one run}', function (): void {
|
|
$limit = (int) $this->option('limit');
|
|
$deleted = app(CleanupService::class)->cleanupStaleDrafts($limit);
|
|
|
|
$this->info("Uploads cleanup deleted {$deleted} draft(s).");
|
|
})->purpose('Delete stale draft uploads and temporary files');
|