@extends('layouts.users_app') @section('styles') @endsection @section('content')
{{ $user->name }}
{{-- @include('layouts.user.sub-header') --}}
Personal
@csrf {{-- {{ dd($user) }} --}}
Contact Info {{-- --}} {{-- --}}
Roles
{{-- --}}
@php $groupedUserTypes = collect(); if (isset($user) && $user && $user->user_type) { $groupedUserTypes = $user->user_type->groupBy('head_office_id'); } @endphp @if ($groupedUserTypes->isNotEmpty()) @foreach ($groupedUserTypes as $headOfficeId => $userTypes) @php // Take the first user type from each group with null safety $usertype = $userTypes ? $userTypes->first() : null; $userJob = $usertype; if(isset($userJob->head_office_id) && !isset($userJob->location_id) && $user->getHeadOfficeUser($headOfficeId) == null){ continue; } // Safe subtype handling $subtypeIds = []; if ($userJob && $userJob->subtypes) { $decodedSubtypes = json_decode($userJob->subtypes, true); $subtypeIds = is_array($decodedSubtypes) ? $decodedSubtypes : []; } $subtypes = collect(); if (count($subtypeIds) > 0) { try { $subtypes = App\Models\jobsubtypes::whereIn('id', $subtypeIds)->get(); } catch (Exception $e) { $subtypes = collect(); } } // Safe also_is handling $alsoIs = []; if ($userJob && $userJob->also_is) { $decodedAlsoIs = json_decode($userJob->also_is, true); if ($decodedAlsoIs) { $alsoIs = is_array($decodedAlsoIs) ? $decodedAlsoIs : [$decodedAlsoIs]; } } // Safe logo path $logoPath = ''; if ($userJob && $userJob->head_office && $userJob->head_office->logo) { $logoPath = $userJob->head_office->logo; } // Safe job title $jobTitle = ''; if ($usertype && $usertype->job_details && $usertype->job_details->job) { $jobTitle = $usertype->job_details->job; } @endphp @if ($usertype)
@if ($jobTitle)

{{ $jobTitle }}

@endif @if ($subtypes->isNotEmpty()) @foreach ($subtypes as $subtype) @if ($subtype && $subtype->subtype_name)

{{ $subtype->subtype_name }}

@endif @endforeach @endif
@if ($logoPath) {{ $jobTitle ?: 'Company Logo' }} @else
No Image
@endif
@endif @endforeach @endif
Security
icon

2-Step Verification

{{ $otp->isEnabled ? 'On' : 'Off' }} since {{ $otp->updated_at->format('d M Y') }}

@if($otp->isEnabled) Via {{ $otp->is_totp_enabled ? 'Microsoft Authenticator' : 'Email' }} @endif
{{ $otp->isEnabled ? 'Disable' : 'Enable' }} @if($otp->isEnabled) @endif
icon

Password

Last changed on {{ isset($user->password_updated_at) ? $user->password_updated_at->format('d M Y') : 'unknown' }}

@section('scripts') @endsection @endsection @section('sidebar') @include('layouts.user.sidebar-header') @endsection