Dear Parent,

Your child {{ $application->student_name }} has been invited for interviews. Please select a suitable time slot from the list below:

@php $groupedSlots = collect($slots)->groupBy(function($slot) { $date = optional($slot->interviewRequest)->interview_date ?? 'Unknown Date'; $location = optional(optional($slot->interviewRequest)->location)->name ?? 'Unknown Location'; return $date . '|' . $location; // composite key for grouping }); @endphp @foreach ($groupedSlots as $key => $dailySlots) @php [$date, $locationName] = explode('|', $key); $isValidDate = \Carbon\Carbon::hasFormat($date, 'Y-m-d') && strtotime($date); @endphp

Interview Date: @if ($isValidDate) {{ \Carbon\Carbon::parse($date)->format('l, F j, Y') }} @else Unknown Date @endif

Location: {{ $locationName }}

@foreach ($dailySlots as $slot) @endforeach
Interview Date Start Time End Time Action
{{ optional($slot->interviewRequest)->interview_date ? \Carbon\Carbon::parse($slot->interviewRequest->interview_date)->format('l, F j, Y') : 'Unknown' }} {{ \Carbon\Carbon::createFromTimeString($slot->start_time)->format('h:i A') }} {{ \Carbon\Carbon::createFromTimeString($slot->end_time)->format('h:i A') }} Book Slot
@endforeach

If you do not respond, the slot may be filled by another applicant.

Thanks,
{{ config('app.name') }}