command('sitemap:generate')->daily()->name('sitemap-generate-daily'); $schedule->call(function () { BrowseAndWriteWithAIJob::dispatch()->onQueue('default')->onConnection('default'); })->everySixHours()->name('write-a-job-6hrs'); $schedule->call(function () { $future_post = Post::whereNotNull('published_at')->where('status', 'future')->where('published_at', '<=', now())->orderBy('published_at', 'ASC')->first(); if (! is_null($future_post)) { PublishIndexPostJob::dispatch($future_post->id)->onQueue('default')->onConnection('default'); } })->everyMinute()->name('schedule-future-post'); } /** * Register the commands for the application. */ protected function commands(): void { $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); } }