@extends('layouts.portal') @section('title', 'Profile') @section('page-header')

Profile

Student information on record.

@endsection @section('content')
{{-- Identity card --}}
{{ $child->initials }}

{{ $child->full_name }}

{{ $child->admission_no }}

@if ($child->class) {{ $child->class->name }} @endif @if ($child->campus) {{ $child->campus->name }} @endif {{ $child->is_active ? 'Active' : 'Inactive' }}
@if ($child->admitted_at)

Enrolled {{ $child->admitted_at->format('j M Y') }}

@endif
{{-- Details --}}
@foreach ([['Date of birth', $child->date_of_birth?->format('j F Y')], ['Gender', $child->gender ? ucfirst($child->gender) : null], ['Blood group', $child->blood_group], ['Email', $child->email], ['Phone', $child->phone], ['National ID no.', $child->national_id_no]] as [$label, $value]) @if ($value)
{{ $label }}
{{ $value }}
@endif @endforeach @php $fullAddress = collect([$child->address, $child->city, $child->state])->filter()->implode(', '); @endphp @if ($fullAddress)
Home address
{{ $fullAddress }}
@endif
@php $health = collect([['Medical conditions', $child->medical_conditions], ['Allergies', $child->allergies], ['Previous school', $child->previous_school]])->filter(fn ($f) => $f[1]); @endphp @if ($health->isEmpty())

Nothing recorded.

@else
@foreach ($health as [$label, $value])
{{ $label }}
{{ $value }}
@endforeach
@endif
@if ($child->parent) @php($guardian = $child->parent)
{{ $guardian->initials }}

{{ $guardian->full_name }}

{{ ucfirst($guardian->relationship ?? 'Guardian') }}@if ($guardian->phone) ยท {{ $guardian->phone }}@endif

@endif @unless ($isParent) @php($editable = collect($editPerms ?? [])->filter()->except('dob')->isNotEmpty()) @if ($editable || ($editPerms['photo'] ?? false))
@csrf @if ($editPerms['photo'] ?? false)
@if ($child->photo_url) @else @endif
@endif
@if ($editPerms['phone'] ?? false) @endif @if ($editPerms['email'] ?? false) @endif @if ($editPerms['address'] ?? false) @endif
@php($fieldsEnabled = ($editPerms['phone'] ?? false) || ($editPerms['email'] ?? false) || ($editPerms['address'] ?? false)) @if ($fieldsEnabled) @endif
@endif @endunless
@endsection