@extends("admin.layouts.master") @section("title","Advertisement Manager") @section("css") @endsection @section("content") {{-- ══ HEADER ══════════════════════════════════════════════ --}}
Advertisement Manager
Image, code & scheduled ads — all in one place
{{-- ══ STATS ════════════════════════════════════════════════ --}}
{{ $advertisements->total() }}
Total Ads
{{ $advertisements->where('position','active')->count() }}
Active
{{ $advertisements->where('type',1)->count() }}
Image Ads
{{ $advertisements->where('type',2)->count() }}
Code Ads
{{-- ══ AD GRID ═════════════════════════════════════════════ --}} @if($advertisements->count() > 0)
@foreach($advertisements as $ad) @php $isActive = $ad->position === 'active'; $tCls = match((int)$ad->type){ 1=>'t-image', 2=>'t-code', default=>'t-disable' }; $tLabel = match((int)$ad->type){ 1=>'Image', 2=>'Code', default=>'Off' }; $tIcon = match((int)$ad->type){ 1=>'fa-image', 2=>'fa-code', default=>'fa-ban' }; @endphp
{{-- Badges --}}
@if($isActive) @endif {{ $isActive ? 'Active' : 'Inactive' }}  {{ $tLabel }}
{{-- Preview --}}
@if($ad->type == 1 && $ad->image) {{ $ad->title }}
View @if($ad->link) Link @endif
@elseif($ad->type == 2)
{{ Str::limit($ad->ad_code, 130) }}
@else
Disabled
@endif
{{-- Body --}}

{{ $ad->title }}

{{ ucfirst($ad->location ?? 'default') }} #{{ $ad->serial ?? 1 }}
@if($ad->link) @endif @if($ad->start_date || $ad->end_date)
{{ $ad->start_date ? \Carbon\Carbon::parse($ad->start_date)->format('d M Y') : '—' }} → {{ $ad->end_date ? \Carbon\Carbon::parse($ad->end_date)->format('d M Y') : '∞' }}
@endif
{{ $ad->created_at->diffForHumans() }}
{{-- Actions --}}
@endforeach
@if($advertisements->hasPages())
{{ $advertisements->links() }}
@endif @else

No Advertisements Yet

Create your first advertisement to start managing promotional content.

@endif {{-- ══════════════════════════════════════════════════════════════ CREATE / EDIT MODAL — Bootstrap 5 ══════════════════════════════════════════════════════════════ --}} @endsection @section("js") @endsection