analysisId = $analysisId; } public function handle(CallAnalysisService $service): void { $service->run($this->analysisId); } /** * Called by the queue once the retries are exhausted. */ public function failed(Throwable $exception): void { $analysis = CallAiAnalysis::find($this->analysisId); if ($analysis && !$analysis->isCompleted()) { $analysis->update([ 'status' => CallAiAnalysis::STATUS_FAILED, 'error' => Str::limit($exception->getMessage(), 900), 'completed_at' => now(), ]); } } }