Afspraken

@if(count($appointments ?? []) > 0) @foreach($appointments as $appointment)
{{ $appointment['time_slot'] }}

{{ $appointment['company_name'] ?? 'Onbekend bedrijf' }}

Afspraak

@endforeach @else

Je hebt nog geen afspraken gepland.

@endif
@for($hour = 9; $hour <= 18; $hour++) @endfor
Tijd Afspraken
{{ sprintf('%02d:00', $hour) }}
@for($quarter = 0; $quarter < 4; $quarter++) @php $minutes = $quarter * 15; $timeSlot = sprintf('%02d:%02d', $hour, $minutes); // Find appointment that matches this time slot $appointment = collect($appointments ?? [])->first(function($app) use ($hour, $minutes) { if (empty($app['time_slot'])) return false; // Parse the time_slot (e.g., "10:30-11:00" or "10:30") $timeSlotParts = explode('-', $app['time_slot']); $startTime = trim($timeSlotParts[0]); if (strpos($startTime, ':') !== false) { list($startHour, $startMin) = explode(':', $startTime); return (int)$startHour === $hour && (int)$startMin >= $minutes && (int)$startMin < $minutes + 15; } return false; }); @endphp
@if($appointment)
{{ $appointment['company_name'] ?? 'Onbekend' }} {{ $appointment['time_slot'] }}
@endif
@endfor