@extends('layouts.admin.master') @section('head') @section('title')Bargain Book Hut β€” Events@endsection @endsection @section('body')
Admin β€Ί Marketing β€Ί Events

Events πŸ–ΌοΈ Promotions

Manage homepage/marketing events β€” image, destination link, and the schedule window they're shown in.

Total Events
{{ $events->total() }}
Active
{{ $activeCount }}
Inactive
{{ $inactiveCount }}
{{-- ── ADD EVENT CARD ── --}}

βž• Add New Event

@include('UI.error')
@csrf
JPG/PNG/WEBP, max 4MB β€” wide event-banner aspect works best (e.g. 1600Γ—600)
{{-- ── EVENTS TABLE CARD ── --}}
@csrf
πŸ”
@if(request()->hasAny(['search','sort']) || request('status','1') !== '1') βœ• Clear @endif {{ $events->total() }} {{ $events->total() == 1 ? 'event' : 'events' }}
@forelse($events as $event) @if(!request()->hasAny(['search','sort']) && $events->currentPage() == 1) @else @endif @empty @endforelse
# Event Schedule Actions Status
β Ώ{{ $loop->iteration }}
{{ $event->title }}
@php $today = \Carbon\Carbon::today(); $starts = $event->starts_at ? \Carbon\Carbon::parse($event->starts_at) : null; $ends = $event->ends_at ? \Carbon\Carbon::parse($event->ends_at) : null; $expired = $ends && $ends->lt($today); @endphp @if(!$starts && !$ends) Always on @elseif($expired) Expired {{ $ends->format('d M Y') }} @else {{ $starts ? $starts->format('d M') : 'β€”' }} β†’ {{ $ends ? $ends->format('d M Y') : 'ongoing' }} @endif
status ?? 1) == 1 ? 'checked' : '' }} onchange="updateEventStatus({{ $event->id }}, this.checked ? 1 : 0)">
πŸ–ΌοΈ

No events yet. Add your first event above.

@if($events->hasPages())
{{ $events->links() }}
@endif
{{-- ── CONFIRM DELETE MODAL ── --}}
βœ… Done
@section('script') @endsection @endsection