{{-- A sponsored placement. $s = SponsorPicker::pick() (or a preview: ['campaign' => …, 'preview' => true]). Class names avoid words content blockers hide on sight; the "Sponsored" label is always shown. --}} @php $c = $s['campaign']; $preview = $s['preview'] ?? false; $click = $preview ? ($c->destination_url ?: '#') : $s['click']; $media = $c->media_type ?? 'text'; $mediaUrl = $s['media_url'] ?? $c->mediaUrl(); $thumbUrl = $s['thumb_url'] ?? $c->thumbUrl(); [$vid, $vhash] = $c->video_id ? \App\Services\Sponsors\VideoLink::split((string) $c->video_id) : [null, null]; @endphp
@if ($media === 'image')
@if ($mediaUrl)@elseYour image@endif
@elseif ($media === 'video')
@if ($mediaUrl)@elseYour video@endif
@elseif ($media === 'video_url')
@if ($thumbUrl)@endif @if ($c->video_provider && $vid) {{ \App\Services\Sponsors\VideoLink::PROVIDERS[$c->video_provider] ?? '' }} @else Your video @endif
@endif
Sponsored · {{ $c->advertiser_name ?: 'Advertiser' }}
{{ $c->headline ?: 'Headline' }}
@if ($c->body)
{{ $c->body }}
@endif
{{ $c->cta ?: 'Learn more' }} {{ $c->domain() }}
@unless ($preview) @push('analytics') {!! \App\Support\Analytics::script([['view_promotion', ['promotion_id' => (string) $c->id, 'promotion_name' => \Illuminate\Support\Str::limit((string) $c->headline, 90, ''), 'creative_name' => $c->advertiser_name, 'creative_slot' => $s['slot'] ?? null]]]) !!} @endpush @endunless