@extends('layouts.app', ['title' => 'Calendario semanal'])
@section('content')
@php
$subjectDetails = $subjects->mapWithKeys(function ($subject) {
return [
$subject->id => [
'title' => $subject->name,
'career' => $subject->career->code.' · '.$subject->year_number.'° año',
'teacher' => $subject->teacher?->name ?? 'Docente a confirmar',
'students' => $subject->enrollments
->sortBy('student.full_name')
->map(fn ($enrollment) => [
'name' => $enrollment->student->full_name,
'status' => $enrollment->status,
])
->values(),
'schedule' => $subject->scheduleSlots
->sortBy(['day_of_week', 'time_slot'])
->map(fn ($slot) => trim($slot->day_of_week.' · '.$slot->time_slot.($slot->classroom ? ' · '.$slot->classroom : '')))
->values(),
],
];
});
@endphp
Vista operativa de las materias cargadas: los días están en columnas y las horas cátedra en filas.
Calendario académico