command(Nightly::class)->dailyAt('01:00'); $schedule->command(Weekly::class)->weeklyOn(0); $schedule->command(Monthly::class)->monthlyOn(1); $schedule->command(Hourly::class)->hourly(); // When spatie-backups runs if (config('backup.backup.enabled', false) === true) { $schedule->command('backup:clean')->daily()->at('01:00'); $schedule->command('backup:run')->daily()->at('02:00'); } // Update the last time the cron was run /** @var CronService $cronSvc */ $cronSvc = app(CronService::class); $cronSvc->updateLastRunTime(); } /** * Register the Closure based commands for the application. * * @return void */ protected function commands(): void { $this->load(__DIR__.'/Commands'); $this->load(__DIR__.'/Cron'); } }