@forelse ($classes as $class) @php $rows = $rosterRows[$class->id] ?? collect(); $complete = $rows->filter(fn ($row) => $row->teacher_id)->count(); $missing = $rows->count() - $complete; @endphp

{{ $class->class_name }}

Wali: {{ $class->waliKelas?->name ?? '-' }} · {{ $rows->count() }} mapel

@if ($missing > 0) {{ $missing }} belum ada guru @elseif ($rows->count() > 0) Lengkap @endif
@if ($rows->count() > 0)
@foreach ($rows as $row)
@if ($row->subject?->type === 'QURAN') @endif {{ $row->subject?->name ?? 'Tanpa nama' }}
@if ($row->teacher_id && $row->teacher) {{ $row->teacher->name }} @else Belum ada guru @endif
@endforeach
@else

Belum ada mapel diampu.

@endif
@empty
@if ($q !== '') Tidak ada kelas yang cocok dengan "{{ $q }}". @else Belum ada data roster. @endif
@endforelse @if ($classes->isNotEmpty()) @php $totalRows = $rosterRows->flatten(1); $totalComplete = $totalRows->filter(fn ($row) => $row->teacher_id)->count(); $totalMissing = $totalRows->count() - $totalComplete; @endphp
{{ $classes->count() }} kelas · {{ $totalRows->count() }} mapel terpetakan @if ($totalMissing > 0) {{ $totalMissing }} belum ada guru @elseif ($totalRows->count() > 0) Semua lengkap @endif
@endif