@extends('layouts.master') @section('title') {{ __('Profile Settings') }} @endsection @section('css') @endsection @section('content') @php $currentUser = $user ?? Auth::user(); $displayRole = __(\App\Support\WorkflowPermission::roleLabelForAdmin((string) ($currentUser->role ?? 'user'))); $rawOrganizationName = trim((string) ($currentUser->organization_name ?? '')); $displayOrganization = ''; if ($rawOrganizationName !== '') { $locale = strtolower((string) app()->getLocale()); $organizationRecord = \App\Models\Organization::where('name', $rawOrganizationName)->first(); if ($organizationRecord) { $displayOrganization = $locale === 'kh' && trim((string) ($organizationRecord->name_kh ?? '')) !== '' ? $organizationRecord->name_kh : (trim((string) ($organizationRecord->name_en ?? '')) !== '' ? $organizationRecord->name_en : $rawOrganizationName); } else { $displayOrganization = $rawOrganizationName; } } $avatarUrl = $currentUser->avatarUrl(); $displayFirstName = trim((string) ($currentUser->first_name ?? '')); $displayLastName = trim((string) ($currentUser->last_name ?? '')); $displayName = trim($displayFirstName . ' ' . $displayLastName); $displayInitial = mb_strtoupper(mb_substr($displayName !== '' ? $displayName : (string) ($currentUser->name ?? 'U'), 0, 1)); @endphp

{{ __('Profile Settings') }}

@csrf
{{ $displayName }}

{{ $displayRole }}

{{ __('Email') }}
{{ $currentUser->email ?: '-' }}
{{ __('Role') }}
{{ $displayRole ?: '-' }}
{{ __('Organization') }}
{{ $displayOrganization !== '' ? $displayOrganization : '-' }}
{{ __('Created At') }}
{{ optional($currentUser->created_at)->format('Y-m-d H:i') ?: '-' }}
{{ __('Edit Profile') }}

{{ __('Update your profile image and personal information.') }}

@error('first_name') {{ $message }} @enderror
@error('last_name') {{ $message }} @enderror
@error('email') {{ $message }} @enderror
@error('avatar')
{{ $message }}
@enderror
{{ __('Update Password') }}

{{ __('Leave the password fields blank if you do not want to change your password.') }}

@error('current_password') {{ $message }} @enderror
@error('password') {{ $message }} @enderror
@error('password_confirmation') {{ $message }} @enderror
@endsection @section('script') @endsection