{{-- brafa Systems — My Profile. Mirror of prototype/admin/views-profile.jsx. Livewire backing is App\Http\Livewire\LaravelExamples\Profile\Edit. Every wire:* directive and property reference below is unchanged from the previous markup — only the surrounding HTML/CSS has been restructured. Properties referenced: $user (Eloquent User — name/email/phone/location) $picture (Livewire WithFileUploads temporary upload) $old_password, $new_password, $confirmationPassword Methods referenced: update(), passwordUpdate() Session flashes referenced: status, demo, error, success Active sessions card is currently cosmetic — the Livewire component has no $sessions state and the brief defers any session-tracking backend to a later pass. The current device row reflects request metadata; "Sign out everywhere" wires to logout. --}} @php use Illuminate\Support\Facades\Auth; $authUser = Auth::user(); $userName = $authUser->name ?? ''; $userInitials = collect(explode(' ', trim((string) $userName))) ->filter() ->take(2) ->map(fn ($p) => strtoupper(mb_substr($p, 0, 1))) ->implode(''); $memberSince = $authUser->created_at?->format('Y-m-d') ?? '—'; $passwordChanged = $authUser->updated_at?->diffForHumans() ?? 'unknown'; $roleLabel = match ((int) ($authUser->role_id ?? 0)) { 1 => 'Superadmin', 2 => 'Admin', default => $authUser->role->name ?? 'Staff', }; $currentDevice = request()->header('User-Agent'); if ($currentDevice && preg_match('/(Chrome|Safari|Firefox|Edge)/i', $currentDevice, $m)) { $browser = $m[1]; } else { $browser = 'Browser'; } if ($currentDevice && preg_match('/(Mac OS X|Windows|Linux|iPhone|iPad|Android)/i', $currentDevice, $m)) { $os = str_replace('Mac OS X', 'macOS', $m[1]); } else { $os = 'Device'; } @endphp