| Server IP : 35.80.110.71 / Your IP : 216.73.216.221 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/client-portal-laravel/backup/routes/ |
Upload File : |
<?php
use App\Jobs\CacheDashboardStatsJob;
use App\Jobs\CheckOverdueInvoicesJob;
use App\Jobs\CleanupExpiredBackupsJob;
use App\Jobs\CleanupOldActivityLogsJob;
use App\Jobs\CleanupOldDeliveriesJob;
use App\Jobs\PermanentlyDeleteOldRecordsJob;
use App\Jobs\ProcessRecurringInvoicesJob;
use App\Jobs\PublishScheduledBlogPostsJob;
use App\Jobs\RetryFailedWebhooksJob;
use App\Jobs\SendInvoiceRemindersJob;
use App\Services\SystemHealthService;
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');
/*
|--------------------------------------------------------------------------
| Scheduled Tasks
|--------------------------------------------------------------------------
|
| Define the application's command schedule. These tasks are run
| automatically by the scheduler when `php artisan schedule:run` is
| executed (typically via cron: * * * * * php artisan schedule:run).
|
*/
// Check for overdue invoices daily at 8am
Schedule::job(new CheckOverdueInvoicesJob)
->dailyAt('08:00')
->name('check-overdue-invoices')
->withoutOverlapping()
->onOneServer();
// Send invoice reminders daily at 9am
Schedule::job(new SendInvoiceRemindersJob)
->dailyAt('09:00')
->name('send-invoice-reminders')
->withoutOverlapping()
->onOneServer();
// Process recurring invoices daily at 7am
Schedule::job(new ProcessRecurringInvoicesJob)
->dailyAt('07:00')
->name('process-recurring-invoices')
->withoutOverlapping()
->onOneServer();
// Cache dashboard stats daily at 6am
Schedule::job(new CacheDashboardStatsJob)
->dailyAt('06:00')
->name('cache-dashboard-stats')
->withoutOverlapping()
->onOneServer();
// Cleanup old activity logs monthly on the 1st at 2am
Schedule::job(new CleanupOldActivityLogsJob)
->monthlyOn(1, '02:00')
->name('cleanup-activity-logs')
->withoutOverlapping()
->onOneServer();
// Permanently delete soft-deleted records quarterly at 3am
Schedule::job(new PermanentlyDeleteOldRecordsJob)
->quarterly()
->at('03:00')
->name('cleanup-soft-deletes')
->withoutOverlapping()
->onOneServer();
// Prune old notifications daily at 4am
Schedule::command('notifications:prune --days=90')
->dailyAt('04:00')
->name('prune-notifications')
->withoutOverlapping()
->onOneServer();
// Prune stale batches weekly on Sunday at 5am
Schedule::command('queue:prune-batches --hours=48')
->weeklyOn(0, '05:00')
->name('prune-batches')
->withoutOverlapping()
->onOneServer();
// Process scheduled reports hourly
Schedule::command('reports:process-scheduled')
->hourly()
->name('process-scheduled-reports')
->withoutOverlapping()
->onOneServer();
// Retry failed webhooks every 5 minutes
Schedule::job(new RetryFailedWebhooksJob)
->everyFiveMinutes()
->name('retry-failed-webhooks')
->withoutOverlapping()
->onOneServer();
// Send discovery call reminders every 15 minutes
Schedule::command('discovery:send-call-reminders')
->everyFifteenMinutes()
->name('send-discovery-call-reminders')
->withoutOverlapping()
->onOneServer();
// Cleanup old webhook deliveries daily at 3am
Schedule::job(new CleanupOldDeliveriesJob)
->dailyAt('03:00')
->name('cleanup-webhook-deliveries')
->withoutOverlapping()
->onOneServer();
// Cleanup expired backups daily at 4:30am
Schedule::job(new CleanupExpiredBackupsJob)
->dailyAt('04:30')
->name('cleanup-expired-backups')
->withoutOverlapping()
->onOneServer();
// Publish scheduled blog posts every 5 minutes
Schedule::job(new PublishScheduledBlogPostsJob)
->everyFiveMinutes()
->name('publish-scheduled-blog-posts')
->withoutOverlapping()
->onOneServer();
// Record scheduler health check every minute
Schedule::call(fn () => SystemHealthService::recordSchedulerRun())
->everyMinute()
->name('record-scheduler-health');