{{-- 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
{{-- ============================================================ Identity card + Basic info card share ONE wire:submit.prevent="update" form (the file input on the avatar must POST together with the inputs below). ============================================================ --}}
@csrf {{-- Identity card --------------------------------------------- --}}
@if ($picture) {{ $userName }} @elseif ($authUser->picture) {{ $userName }} @else
{{ $userInitials ?: '?' }}
@endif

{{ $userName }}

{{ $roleLabel }} {{ $authUser->email }} @if ($authUser->location) {{ $authUser->location }} @endif
Member since {{ $memberSince }}
@error('picture')
{{ $message }}
@enderror @if (session('status'))
{{ session('status') }}
@endif @if (session('demo'))
{{ session('demo') }}
@endif {{-- Basic info card -------------------------------------------- --}}

Basic info

Required to receive notifications
@error('user.name')

{{ $message }}

@enderror
@error('user.email')

{{ $message }}

@enderror
@error('user.location')

{{ $message }}

@enderror
@error('user.phone')

{{ $message }}

@enderror
{{-- ============================================================ Change password card ============================================================ --}}
@csrf

Change password

Last changed {{ $passwordChanged }}
@if (session('error'))
{{ session('error') }}
@endif @if (session('success'))
{{ session('success') }}
@endif
@error('old_password')

{{ $message }}

@enderror
@error('new_password')

{{ $message }}

@enderror
Password must contain
12+ characters Uppercase letter Lowercase letter Number Special character
{{-- ============================================================ Active sessions card — cosmetic placeholder. Renders the current device only; "Sign out everywhere" is wired to the existing logout route until a session-tracking backend lands. ============================================================ --}}

Active sessions

@csrf
{{ $browser }} · {{ $os }} {{ $authUser->location ?: 'Unknown location' }} · Active now
Current
@push('js') @endpush