@extends('theme::layout')
@section('title', 'Events')
@section('content')
@include('theme::_hero_banner', [
'heroTitle' => 'Events',
'heroSubtitle' => 'Upcoming services, gatherings, and community events',
'breadcrumbs' => [
['label' => 'Home', 'url' => route('web.home')],
['label' => 'Events']],
])
{{-- Upcoming Events --}}
Upcoming Events
@php
use Illuminate\Support\Str;
@endphp
@if($upcoming->count())
{{ $upcoming->appends(request()->except('upcoming_page'))->links() }}
@else
No upcoming events.
@endif
{{-- Completed Events --}}
Completed Events
@if(count($completed))
@php
$completedJs = [];
foreach($completed as $year => $months) {
foreach($months as $month => $events) {
$key = $year . '::' . $month;
$completedJs[$key] = collect($events)->map(function($e) {
$image = null;
if ($e->image) {
$image = Str::startsWith($e->image, ['http://', 'https://'])
? $e->image
: \Storage::url($e->image);
}
return [
'id' => $e->id,
'title' => $e->title,
'date' => \Carbon\Carbon::parse($e->start_date)->format('d M Y, g:i A'),
'location' => $e->location,
'image' => $image,
];
})->values()->all();
}
}
@endphp
{{-- LEFT: Year / Month Nav --}}
@foreach($completed as $year => $months)
{{-- Year header --}}
{{-- Months --}}
@foreach($months as $month => $events)
@endforeach
@endforeach
{{-- RIGHT: Events panel --}}
{{-- Panel header --}}
{{-- Event cards --}}
No events for this month.
@else
No completed events.
@endif
@endsection