@php $editId = (int) request('edit'); $row = $editId ? $events->firstWhere('id', $editId) : null; $open = $row || request()->has('new') || $errors->any(); $upcoming = $events->where('status', 'published')->filter(fn ($e) => $e->starts_at->isFuture())->count(); $modes = ['online' => 'Online', 'onsite' => 'On campus', 'hybrid' => 'Hybrid (campus + online)']; @endphp @if($open)
@endif| Event | When | Format | Status | Actions |
|---|---|---|---|---|
| {{ $e->title }}{{ $e->location ?: ($e->meeting_url ? 'Online link added' : 'No venue or link yet') }} | {{ $e->starts_at->format('D, d M Y') }}{{ $e->starts_at->format('g:i A') }}{{ $e->ends_at ? ' – '.$e->ends_at->format('g:i A') : '' }} · {{ $e->starts_at->isPast() ? 'past' : 'upcoming' }} | {{ $modes[$e->mode] ?? ucfirst($e->mode) }} |