@extends('layouts.app') @section('title', $studentParent->displayName()) @section('content') @php $studentsCount = $studentParent->students_count ?? $studentParent->students()->count(); $activeStudentsCount = $studentParent->students() ->where('is_active', true) ->count(); $hasStudents = $studentsCount > 0; $primaryName = $studentParent->displayName(); @endphp
{{-- ============================================================ Page Header ============================================================ --}}

{{ $primaryName }}

@if($studentParent->is_active) Active @else Inactive @endif

Parent, guardian, communication and linked student information.

{{-- Actions --}}
All Parents @can('parents.edit') Edit Parent @endcan
{{-- ============================================================ Summary Cards ============================================================ --}}
{{-- Linked Students --}}

Linked Students

{{ number_format($studentsCount) }}

{{-- Active Students --}}

Active Students

{{ number_format($activeStudentsCount) }}

{{-- SMS --}}

SMS

@if($studentParent->canReceiveSms()) Enabled @else Disabled @endif
{{-- Email --}}

Email

@if($studentParent->canReceiveEmail()) Enabled @else Disabled @endif
{{-- ============================================================ Main Information ============================================================ --}}
{{-- ======================================================== Parent Information ======================================================== --}}

Parent Information

Primary family and contact information.

{{-- Father --}}
Father Name
{{ $studentParent->father_name ?: '—' }}
{{-- Mother --}}
Mother Name
{{ $studentParent->mother_name ?: '—' }}
{{-- Primary Phone --}}
Primary Phone
@if($studentParent->primary_phone) {{ $studentParent->primary_phone }} @else @endif
{{-- Alternate Phone --}}
Alternate Phone
@if($studentParent->alternate_phone) {{ $studentParent->alternate_phone }} @else @endif
{{-- Email --}}
Primary Email
@if($studentParent->email) {{ $studentParent->email }} @else @endif
{{-- Status --}}
Status
@if($studentParent->is_active) Active @else Inactive @endif
{{-- Record ID --}}
Record ID
#{{ $studentParent->id }}
{{-- Students --}}
Linked Students
{{ number_format($studentsCount) }}
{{-- Address --}}

Address

@if($studentParent->address)

{{ $studentParent->address }}

@else

No address has been added for this parent.

@endif
{{-- ======================================================== Guardian Information ======================================================== --}}

Guardian Information

Additional guardian contact details.

@if( $studentParent->guardian_name || $studentParent->guardian_phone || $studentParent->guardian_email )

{{ $studentParent->guardian_name ?: 'Guardian' }}

@if($studentParent->guardian_relation)

{{ $studentParent->guardian_relation }}

@endif
{{-- Relation --}}
Relationship {{ $studentParent->guardian_relation ?: '—' }}
{{-- Phone --}}
Phone @if($studentParent->guardian_phone) {{ $studentParent->guardian_phone }} @else @endif
{{-- Email --}}
Email @if($studentParent->guardian_email) {{ $studentParent->guardian_email }} @else @endif
@else

No Guardian Information

No additional guardian details have been added.

@endif
{{-- ============================================================ Communication ============================================================ --}}

Communication Preferences

Communication channels configured for this family.

{{-- SMS --}}

SMS Notifications

Messages are sent to the primary phone number.

@if($studentParent->sms_enabled) Enabled @else Disabled @endif
SMS Number {{ $studentParent->primary_phone ?: '—' }}
Can Receive SMS @if($studentParent->canReceiveSms()) Yes @else No @endif
{{-- Email --}}

Email Notifications

Notices and school communication by email.

@if($studentParent->email_enabled) Enabled @else Disabled @endif
Email Address {{ $studentParent->email ?: '—' }}
Can Receive Email @if($studentParent->canReceiveEmail()) Yes @else No @endif
{{-- ============================================================ Linked Students ============================================================ --}}

Linked Students

Students associated with this parent or guardian.

{{ number_format($studentsCount) }} {{ $studentsCount === 1 ? 'Student' : 'Students' }}
@php $students = $studentParent->students() ->with([ 'academicYear', 'schoolClass', 'section', ]) ->orderBy('first_name') ->orderBy('last_name') ->get(); @endphp @if($students->isNotEmpty())
@foreach($students as $student) {{-- Student --}} {{-- ID --}} {{-- Class --}} {{-- Roll --}} {{-- Academic Year --}} {{-- Status --}} {{-- Action --}} @endforeach
Student Student ID Class Roll No. Academic Year Status Action
@if($student->profile_photo) {{ $student->fullName() }} @else
{{ mb_strtoupper( mb_substr( $student->first_name, 0, 1 ) ) }}
@endif

{{ $student->fullName() }}

@if($student->student_email)

{{ $student->student_email }}

@endif
{{ $student->student_id }} @if($student->schoolClass)

{{ $student->schoolClass->name }}

@if($student->section)

Section {{ $student->section->name }}

@endif @else @endif
{{ $student->roll_no ?: '—' }} @if($student->academicYear)
{{ $student->academicYear->name }} @if($student->academicYear->is_current) Current @endif
@else @endif
@if($student->is_active) Active @else Inactive @endif
@can('students.view') @else @endcan
@else

No Students Linked

No students are currently associated with this parent.

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

Record Information

System information for this parent record.

{{-- Created --}}
Created
{{ $studentParent->created_at?->format('d M Y, h:i A') ?? '—' }}
{{-- Updated --}}
Last Updated
{{ $studentParent->updated_at?->format('d M Y, h:i A') ?? '—' }}
{{-- Record ID --}}
Record ID
#{{ $studentParent->id }}
{{-- ======================================================== Record Management ======================================================== --}}

Record Management

Manage or remove this parent record.

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

Edit Parent

Update parent, guardian, contact information or communication preferences.

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

Parent protected from deletion

This parent has {{ number_format($studentsCount) }} {{ $studentsCount === 1 ? 'student' : 'students' }} linked to the record. Reassign the students or set this parent to inactive instead of deleting it.

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