@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