with(['backgroundImage', 'user'])->find($this->cardId); if (! $card) { return; } // Try the CSS/Playwright renderer first (pixel-perfect match with the editor). // Falls back to the GD renderer if Playwright is disabled or encounters an error. if ($playwrightService->isAvailable()) { try { $playwrightService->render($card); } catch (\Throwable $e) { report($e); $renderService->render($card->fresh()->load(['backgroundImage'])); } } else { $renderService->render($card); } $evaluation = $moderation->evaluate($card->fresh()->loadMissing(['originalCard.user', 'rootCard.user'])); $moderation->applyPublishOutcome($card->fresh(), $evaluation); } public function failed(\Throwable $exception): void { $card = NovaCard::query()->find($this->cardId); if (! $card) { return; } $card->forceFill([ 'status' => NovaCard::STATUS_DRAFT, 'moderation_status' => NovaCard::MOD_PENDING, ])->save(); } }