@php $seatsLeft = $session->capacity !== null ? max(0, $session->capacity - $session->attendees_count) : null; $started = $session->hasStarted(); $details = [ 'Date' => $session->starts_at->format('l, j F Y'), 'Time' => $session->starts_at->format('g:i a').' to '.$session->ends_at->format('g:i a'), 'Venue' => $session->venue, 'Seats' => $session->capacity === null ? $session->attendees_count.' registered, no limit' : $session->attendees_count.' of '.$session->capacity.' taken', ]; @endphp
Calendar

{{ $session->title }}

@if ($manages) @endif

Face-to-face session of {{ $session->course->title }}

@foreach ($details as $label => $value)
{{ $label }}
{{ $value }}
@endforeach
@if ($session->notes)

What to bring and know

{{ $session->notes }}

@endif
@if ($manages) {{-- Attendance --}}

Attendance

@php $present = $attendees->where('pivot.attended', true)->count(); @endphp

{{ $present }} of {{ $attendees->count() }} present

@if ($attendees->isEmpty())

No one has registered yet. Enrolled staff sign up from this page or the calendar.

@else
@csrf @method('PUT')
    @foreach ($attendees as $a) @php $mark = $a->pivot->attended; @endphp
  • {{ $a->name }}

    {{ collect([$a->staff_id, $a->department])->filter()->join(', ') ?: '—' }}

    Attendance for {{ $a->name }} @foreach (['1' => 'Present', '0' => 'Absent'] as $value => $label) @endforeach
  • @endforeach
@endif
@endif