@extends('layouts.app') @section('title', $teacher->fullName()) @section('content') @php $assignmentsCount = $teacher->assignments_count ?? $teacher->assignments()->count(); $employmentType = match ($teacher->employment_type) { 'full_time' => 'Full Time', 'part_time' => 'Part Time', 'contract' => 'Contract', 'temporary' => 'Temporary', default => ucfirst(str_replace('_', ' ', $teacher->employment_type ?? '')), }; $gender = match ($teacher->gender) { 'male' => 'Male', 'female' => 'Female', 'other' => 'Other', default => '—', }; $age = $teacher->date_of_birth ? $teacher->date_of_birth->age : null; $serviceDuration = $teacher->joining_date ? $teacher->joining_date->diffForHumans( now(), true ) : null; $hasAssignments = $assignmentsCount > 0; @endphp
{{-- ============================================================ Page Header ============================================================ --}}

{{ $teacher->fullName() }}

{{ $teacher->teacher_id }} @if($teacher->is_active) Active @else Inactive @endif @if($teacher->is_class_teacher) Class Teacher @endif

Teacher profile, employment information and academic assignments.

{{-- Actions --}}
All Teachers @can('teachers.edit') Edit Teacher @endcan
{{-- ============================================================ Summary Cards ============================================================ --}}
{{-- Assignments --}}

Assignments

{{ number_format($assignmentsCount) }}

{{-- Employment --}}

Employment

{{ $employmentType ?: '—' }}

{{-- Joining --}}

Joined

{{ $teacher->joining_date?->format('d M Y') ?? '—' }}

{{-- Class Teacher --}}

Class Teacher

{{ $teacher->is_class_teacher ? 'Yes' : 'No' }}

{{-- ============================================================ Profile + Employment ============================================================ --}}
{{-- ======================================================== Teacher Profile ======================================================== --}}

Teacher Information

Personal and contact information for this teacher.

{{-- Profile Header --}}
@if($teacher->hasPhoto()) {{ $teacher->fullName() }} @else
{{ strtoupper(substr($teacher->first_name, 0, 1)) }}{{ $teacher->last_name ? strtoupper(substr($teacher->last_name, 0, 1)) : '' }}
@endif

{{ $teacher->fullName() }}

@if($teacher->is_class_teacher) Class Teacher @endif

{{ $teacher->designation }}

{{ $teacher->teacher_id }} @if($teacher->phone) {{ $teacher->phone }} @endif @if($teacher->email) {{ $teacher->email }} @endif
{{-- Details --}}
{{-- Teacher ID --}}
Teacher ID
{{ $teacher->teacher_id }}
{{-- Full Name --}}
Full Name
{{ $teacher->fullName() }}
{{-- Gender --}}
Gender
{{ $gender }}
{{-- DOB --}}
Date of Birth
@if($teacher->date_of_birth) {{ $teacher->date_of_birth->format('d M Y') }} @if($age !== null) ({{ $age }} years) @endif @else — @endif
{{-- Phone --}}
Phone Number
@if($teacher->phone) {{ $teacher->phone }} @else @endif
{{-- Email --}}
Email Address
@if($teacher->email) {{ $teacher->email }} @else @endif
{{-- Record ID --}}
Record ID
#{{ $teacher->id }}
{{-- Status --}}
Status
@if($teacher->is_active) Active @else Inactive @endif
{{-- Address --}}

Address

@if($teacher->address)

{{ $teacher->address }}

@else

No address has been added for this teacher.

@endif
{{-- ======================================================== Employment Information ======================================================== --}}

Employment Information

Current employment configuration.

{{ $teacher->designation }}

{{ $employmentType }}

{{-- Joining Date --}}
Joining Date {{ $teacher->joining_date?->format('d M Y') ?? '—' }}
{{-- Service Duration --}}
Service Duration {{ $serviceDuration ?: '—' }}
{{-- Employment Type --}}
Employment Type {{ $employmentType ?: '—' }}
{{-- Class Teacher --}}
Class Teacher @if($teacher->is_class_teacher) Yes @else No @endif
{{-- Status --}}
Employment Status @if($teacher->is_active) Active @else Inactive @endif
{{-- Qualification --}}

Qualification

@if($teacher->qualification)

{{ $teacher->qualification }}

@else

No qualification information added.

@endif
{{-- ============================================================ Academic Assignments ============================================================ --}}

Academic Assignments

Classes and sections assigned to this teacher.

@can('teacher-assignments.view') View All @endcan
@if($teacher->relationLoaded('assignments') && $teacher->assignments->isNotEmpty())
@foreach($teacher->assignments as $assignment) {{-- Academic Year --}} {{-- Class --}} {{-- Section --}} {{-- Assignment --}} @endforeach
Academic Year Class Section Assignment
@if($assignment->academicYear)
{{ $assignment->academicYear->name }} @if($assignment->academicYear->is_current) Current @endif
@else @endif
@if($assignment->schoolClass) {{ $assignment->schoolClass->name }} @else @endif @if($assignment->section) {{ $assignment->section->name }} @else All / — @endif @if($teacher->is_class_teacher) Class Teacher @else Teacher @endif
@elseif($hasAssignments)

{{ number_format($assignmentsCount) }} {{ Str::plural('assignment', $assignmentsCount) }}

Assignment details are not currently loaded.

@can('teacher-assignments.view') View Assignments @endcan
@else

No Assignments

This teacher has not been assigned to any class or section yet.

@endif
{{-- ============================================================ Teacher Overview ============================================================ --}}
{{-- Identity --}}
#{{ $teacher->id }}

Teacher Identity

Unique teacher identification used throughout the attendance system.

{{ $teacher->teacher_id }}

{{-- Employment --}}
{{ $employmentType }}

Employment

Current designation and employment arrangement.

{{ $teacher->designation }}

{{-- Assignments --}}
{{ number_format($assignmentsCount) }}

Assignments

Academic class and section assignments connected to this teacher.

@can('teacher-assignments.view') View Assignments @endcan
{{-- Service --}}

Service Duration

Time since this teacher joined the school.

{{ $serviceDuration ?: '—' }}

{{-- ============================================================ Record / Management ============================================================ --}}
{{-- ======================================================== Record Information ======================================================== --}}

Record Information

System information for this teacher record.

{{-- Created --}}
Created
{{ $teacher->created_at?->format('d M Y, h:i A') ?? '—' }}
{{-- Updated --}}
Last Updated
{{ $teacher->updated_at?->format('d M Y, h:i A') ?? '—' }}
{{-- Joining Date --}}
Joined School
{{ $teacher->joining_date?->format('d M Y') ?? '—' }}
{{-- ======================================================== Record Management ======================================================== --}}

Record Management

Manage or remove this teacher.

{{-- Edit --}} @can('teachers.edit')

Edit Teacher

Update personal information, employment details, status or profile photo.

@endcan {{-- Delete --}} @can('teachers.delete') @if(!$hasAssignments)
@csrf @method('DELETE')
@else

Teacher protected from deletion

This teacher has academic assignments. Set the teacher to inactive instead of deleting the record.

@if($teacher->is_active) @can('teachers.edit') Change Status @endcan @endif
@endif @endcan
@endsection @push('scripts') @endpush