@php $user = auth()->user(); // Profile completeness check — competitive exam student fields $profileFields = collect([ 'name' => ['label' => 'Full name', 'value' => $user->name], 'email' => ['label' => 'Email address', 'value' => $user->email], 'phone' => ['label' => 'Phone number', 'value' => $user->phone], 'date_of_birth' => ['label' => 'Date of birth', 'value' => $user->date_of_birth], 'sex' => ['label' => 'Gender', 'value' => $user->sex], 'target_exam' => ['label' => 'Target exam', 'value' => $user->department ?? null], 'profile_photo' => ['label' => 'Profile photo', 'value' => $user->profile_photo], ]); $profileChecks = $profileFields->pluck('value'); $profileCompletion = (int) round( ($profileChecks->filter(fn ($value) => filled($value))->count() / max($profileChecks->count(), 1)) * 100 ); $missingProfileFields = $profileFields ->filter(fn ($field) => blank($field['value'])) ->pluck('label') ->values(); $hour = (int) now()->format('H'); $greeting = $hour < 12 ? 'Good morning' : ($hour < 17 ? 'Good afternoon' : 'Good evening'); @endphp

{{ __('My Profile') }}

{{-- HERO --}}
{{-- LEFT --}} {{-- RIGHT --}}
{{ $greeting }}, {{ Str::before($user->name, ' ') }}

Update your personal details, change your password, and keep your account secure — all in one place.

{{-- PROFILE COMPLETION --}}
Profile completion
{{ $profileCompletion }}%

@if($missingProfileFields->isEmpty()) Your profile is fully complete. 🎉 @else Add {{ $missingProfileFields->join(', ', ' and ') }} to complete your profile. @endif

Email {{ $user->email }}
Member since {{ $user->created_at->format('d M Y') }}
Phone {{ $user->phone ?: 'Not set' }}
Date of birth {{ optional($user->date_of_birth)->format('d M Y') ?: 'Not set' }}
{{-- PROFILE INFO FORM --}}
@include('profile.partials.update-profile-information-form')
{{-- PASSWORD + DELETE --}}
@include('profile.partials.update-password-form')
@include('profile.partials.delete-user-form')