@php $config = $this->getConfig(); $originals = $this->getOriginalImages(); $overlaid = $this->getOverlaidImages(); $currentHash = $config?->computeHash(); $styleName = match ($config?->style) { 'corner_flag' => 'Corner Flag', default => 'Framed Plate', }; @endphp @if (! $config)
No enabled overlay config found for this company. Go to Settings → Image Watermark → Overlay Configs to create one.
@elseif (empty($originals))
This product has no images to overlay.
@else @if ($overlayQueuedAt)
@endif
Overlay Images
Main image only {{ $styleName }} @if ($overlayQueuedAt) Processing… @endif
@foreach (array_slice($originals, 0, 1) as $filename) @php $entry = $overlaid[$filename] ?? null; $originalUrl = $this->resolveImageUrl($filename); $overlaidUrl = $entry ? $this->resolveImageUrl($entry['overlaid_filename']) : null; $isStale = $entry && $entry['config_hash'] !== $currentHash; $isFailed = $entry && $entry['status'] === 'failed'; $processedAt = $entry ? \Carbon\Carbon::parse($entry['processed_at'])->diffForHumans() : null; @endphp
{{-- Original --}}
@if ($originalUrl) Original @else
No image
@endif Original
{{-- Overlaid --}}
@if ($overlaidUrl && ! $isFailed) Overlaid @else
@if ($isFailed) {{ Str::limit($entry['error_message'] ?? 'Processing failed', 60) }} @else Not yet processed.
Click Re-overlay Images to generate. @endif
@endif {{ $isFailed ? 'Failed' : 'Overlaid' }}
@if ($isFailed) Failed {{ $processedAt }} @elseif ($entry && ! $isStale) Processed {{ $processedAt }} @elseif ($isStale) Stale — config changed since {{ $processedAt }} @else Not yet processed @endif
@endforeach
@endif