@extends('admin.layouts.app') @section('title', 'Teacher Schedule') @section('breadcrumb') @endsection @section('content')
@if(request('employee_id') && $schedules->count()) @php $days = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; @endphp
@foreach($days as $day) @php $daySlots = $schedules->where('day_of_week', $day); @endphp @if($daySlots->count())
{{ $day }}
@foreach($daySlots->sortBy('start_time') as $slot)
{{ date('h:i A', strtotime($slot->start_time)) }}
– {{ date('h:i A', strtotime($slot->end_time)) }}
{{ $slot->subject?->name }}
{{ $slot->class?->name }}
@if($slot->room)
{{ $slot->room }}
@endif
@endforeach
@endif @endforeach
@elseif(request('employee_id'))

No schedule found for this teacher

@endif @endsection