@extends('components.app-layout') @section('title', 'Events') @section('subtitle', 'Manage church events and activities') @section('content')

Church Events

Discover and manage upcoming church activities

Total Events

{{ $eventStats['total'] ?? 0 }}

This Month

{{ $eventStats['this_month'] ?? 0 }}

Upcoming

{{ $eventStats['upcoming'] ?? 0 }}

Create Event

Find Events

@forelse($events ?? [] as $event)
@php $eventTypeColors = [ 'service' => 'from-blue-600 via-blue-700 to-blue-800', 'meeting' => 'from-green-600 via-green-700 to-green-800', 'conference' => 'from-red-600 via-red-700 to-red-800', 'workshop' => 'from-yellow-600 via-yellow-700 to-yellow-800', 'social' => 'from-pink-600 via-pink-700 to-pink-800', 'outreach' => 'from-purple-600 via-purple-700 to-purple-800', 'fundraising' => 'from-orange-600 via-orange-700 to-orange-800', 'other' => 'from-gray-600 via-gray-700 to-gray-800' ]; $colorClass = $eventTypeColors[$event->event_type ?? 'other'] ?? $eventTypeColors['other']; @endphp
{{ $event->start_datetime ? $event->start_datetime->format('M') : now()->format('M') }}
{{ $event->start_datetime ? $event->start_datetime->format('d') : now()->format('d') }}
@if($event->status === 'published')
@elseif($event->status === 'draft')
@elseif($event->status === 'cancelled')
@endif

{{ $event->title }}

@php $statusConfig = [ 'published' => ['color' => 'from-green-500 to-emerald-500', 'icon' => 'fas fa-check', 'text' => 'Published'], 'draft' => ['color' => 'from-yellow-500 to-orange-500', 'icon' => 'fas fa-edit', 'text' => 'Draft'], 'cancelled' => ['color' => 'from-red-500 to-red-600', 'icon' => 'fas fa-times', 'text' => 'Cancelled'], 'completed' => ['color' => 'from-blue-500 to-blue-600', 'icon' => 'fas fa-flag-checkered', 'text' => 'Completed'] ]; $status = $event->status ?? 'draft'; $config = $statusConfig[$status] ?? $statusConfig['draft']; // Check if event is upcoming $isUpcoming = $event->start_datetime && $event->start_datetime->isFuture(); @endphp {{ $config['text'] }} @if($isUpcoming && $status === 'published') Upcoming @endif {{ ucfirst(str_replace('_', ' ', $event->event_type ?? 'other')) }}

{{ $event->description ?: 'No description available for this event.' }}

Time

@if($event->is_all_day)

All Day

@else

{{ $event->start_datetime ? $event->start_datetime->format('g:i A') : 'TBD' }} @if($event->end_datetime) - {{ $event->end_datetime->format('g:i A') }} @endif

@endif

Location

{{ $event->location ?: 'Location TBD' }}

Attendance

{{ $event->registered_count ?? 0 }} registered @if($event->checked_in_count ?? 0 > 0) ({{ $event->checked_in_count }} present) @endif

@if($event->ministry)
{{ $event->ministry->name }}
@endif @if($event->organizer)
Organized by {{ $event->organizer->first_name }} {{ $event->organizer->last_name }}
@endif @if($event->registration_fee && $event->registration_fee > 0)
₵{{ number_format($event->registration_fee, 2) }}
@else
Free Event
@endif @if($event->max_attendees)
Max {{ $event->max_attendees }} attendees
@endif
View Details @if($event->start_datetime && $event->start_datetime->isFuture() && $event->status === 'published')
{{ $event->start_datetime->diffForHumans() }}
@endif
@empty

No events found

Get started by scheduling your first church event.

Schedule First Event
@endforelse
@if(isset($events) && $events->hasPages())
{{ $events->links() }}
@endif
@endsection