@props(['slots', 'entries', 'days']) @php $daysPresent = $slots->pluck('day_of_week')->unique()->sort()->values(); $timeBands = $slots->pluck('start_time')->map(fn ($t) => $t->format('H:i'))->unique()->sort()->values(); @endphp @if($slots->isEmpty() || $entries->isEmpty())
| Time | @foreach($daysPresent as $day){{ $days[$day] }} | @endforeach
|---|---|
| {{ $band }} | @foreach($daysPresent as $day) @php $slot = $slots->first(fn($s) => $s->day_of_week === $day && $s->start_time->format('H:i') === $band); @endphp
@if($slot)
@foreach(($entries[$slot->day_of_week.'-'.$slot->id] ?? []) as $entry)
{{ $entry->courseOffering->subject->name }} {{ $entry->courseOffering->section->label() }} |
@endforeach