41 lines
1.4 KiB
PHP
41 lines
1.4 KiB
PHP
<?php
|
|
|
|
use App\Console\Commands\PublishScheduledPressReleases;
|
|
use App\Console\Commands\PurgeExpiredPressReleaseDrafts;
|
|
use App\Console\Commands\PurgeMagicLinks;
|
|
use Illuminate\Foundation\Inspiring;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
use Illuminate\Support\Facades\Schedule;
|
|
|
|
Artisan::command('inspire', function () {
|
|
$this->comment(Inspiring::quote());
|
|
})->purpose('Display an inspiring quote');
|
|
|
|
// ========================================
|
|
// Tägliche Bereinigungen
|
|
// ========================================
|
|
|
|
// Magic-Links: Abgelaufene / verbrauchte Tokens entfernen (täglich 03:00)
|
|
Schedule::command(PurgeMagicLinks::class, ['--days=30'])
|
|
->dailyAt('03:00')
|
|
->withoutOverlapping()
|
|
->runInBackground();
|
|
|
|
// PM-Entwürfe: Zombie-Drafts nach 180 Tagen Inaktivität archivieren (wöchentlich)
|
|
Schedule::command(PurgeExpiredPressReleaseDrafts::class, ['--days=180'])
|
|
->weekly()
|
|
->sundays()
|
|
->at('04:00')
|
|
->withoutOverlapping()
|
|
->runInBackground();
|
|
|
|
// ========================================
|
|
// Geplante PM-Veröffentlichung
|
|
// ========================================
|
|
|
|
// PM mit scheduled_at <= now & Status review automatisch veröffentlichen.
|
|
// Läuft alle 5 Min — passt zum FormRule "scheduled_at min. 5 Min in Zukunft".
|
|
Schedule::command(PublishScheduledPressReleases::class)
|
|
->everyFiveMinutes()
|
|
->withoutOverlapping()
|
|
->runInBackground();
|