@extends('layouts.app') @section('title', 'Teacher Dashboard') @section('page-title', 'Dashboard') @section('content') @php $hour = now()->hour; $greeting = $hour < 12 ? 'Good Morning' : ($hour < 17 ? 'Good Afternoon' : 'Good Evening'); $maxAttendance = collect($chartData)->max(fn($d) => $d['present'] + $d['absent']) ?: 1; @endphp
{{-- Greeting --}}

{{ $greeting }}, {{ explode(' ', auth()->user()->name)[0] }}

Here's an overview of your classes and activities

{{-- Stats Cards --}}

My Classes

{{ $classes->count() }}

Total Students

{{ $totalStudents }}

Pending Reviews

{{ $pendingAssignments }}

Upcoming Exams

{{ $upcomingExams->count() }}

{{-- Left content --}}
{{-- Attendance Chart --}} @if(count($chartData) > 0)

Attendance Report

Your classes · Last 10 days

Present Absent
@foreach($chartData as $day)
@if($day['absent'] > 0)
@endif
{{ $day['date'] }}
@endforeach
@endif {{-- My Classes --}}

My Classes

@foreach($classes as $class)
{{ preg_replace('/[^0-9]/', '', $class->name) }}

{{ $class->full_name }}

{{ $class->students->count() ?? 0 }} students

@endforeach
{{-- Upcoming Exams --}} @if($upcomingExams->isNotEmpty())

Upcoming Exams

@foreach($upcomingExams as $exam) @endforeach
Exam Subject Class Date
{{ $exam->name }} {{ $exam->subject->name ?? '—' }} {{ $exam->class_?->full_name ?? '—' }} {{ $exam->exam_date->format('d M') }}
@endif
{{-- Right sidebar --}}
{{-- Quick Actions --}} {{-- Mini Calendar --}}
@php $today = now(); $firstDay = $today->copy()->startOfMonth(); $lastDay = $today->copy()->endOfMonth(); @endphp

{{ $today->format('F Y') }}

@foreach(['S','M','T','W','T','F','S'] as $d)
{{ $d }}
@endforeach @for($i = 0; $i < $firstDay->dayOfWeek; $i++)
@endfor @for($d = 1; $d <= $lastDay->day; $d++)
{{ $d }}
@endfor
{{-- Upcoming Events --}} @include('components.upcoming-events') {{-- Announcements --}}

Announcements

@forelse($recentAnnouncements as $a)

{{ $a->title }}

{{ $a->created_at->diffForHumans() }}

@empty
No announcements
@endforelse
@endsection