Implement creator studio and upload updates

This commit is contained in:
2026-04-04 10:12:02 +02:00
parent 1da7d3bf88
commit 0b216b7ecd
15107 changed files with 31206 additions and 626514 deletions

View File

@@ -6,6 +6,7 @@ namespace App\Jobs\NovaCards;
use App\Models\NovaCard;
use App\Services\NovaCards\NovaCardPublishModerationService;
use App\Services\NovaCards\NovaCardPlaywrightRenderService;
use App\Services\NovaCards\NovaCardRenderService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
@@ -22,14 +23,25 @@ class RenderNovaCardPreviewJob implements ShouldQueue
) {
}
public function handle(NovaCardRenderService $renderService, NovaCardPublishModerationService $moderation): void
public function handle(NovaCardRenderService $renderService, NovaCardPlaywrightRenderService $playwrightService, NovaCardPublishModerationService $moderation): void
{
$card = NovaCard::query()->with(['backgroundImage'])->find($this->cardId);
$card = NovaCard::query()->with(['backgroundImage', 'user'])->find($this->cardId);
if (! $card) {
return;
}
$renderService->render($card);
// 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']));