onQueue('ai-content'); } public function handle(ArticleCoverService $covers): void { $article = Article::query()->find($this->articleId); if ($article === null) { return; } try { $covers->apply($article, $this->strategy); } catch (\Throwable $exception) { Log::warning('GenerateArticleCoverJob failed.', [ 'article_id' => $this->articleId, 'strategy' => $this->strategy, 'message' => $exception->getMessage(), ]); $article->forceFill([ 'cover_status' => ArticleCoverService::STATUS_FAILED, 'cover_generated_at' => now(), ])->save(); } } }