@extends('layouts.app') @section('title', 'User Details') @section('content')
{{ $user->name }}
Edit Back
Basic Information
Email
{{ $user->email }}
Employee Code
{{ $user->employee_code ?? '—' }}
Phone
{{ $user->phone ?? '—' }}
Designation
{{ $user->designation ?? '—' }}
Staff Type
{{ ucfirst($user->staff_type ?? '—') }}
Status
{{ ucfirst($user->status) }}
Joined
{{ optional($user->joined_date)->format('d M Y') ?? '—' }}
Role & Hierarchy
Role(s)
@forelse ($user->roles as $role) {{ ucwords(str_replace('_', ' ', $role->name)) }} @empty — @endforelse
Region
{{ $user->region?->name ?? '—' }}
@if ($user->country)
Country
{{ $user->country }}
@endif @if ($user->staffState)
State
{{ $user->staffState->name }}
@endif @if ($user->staffPlace)
District
{{ $user->staffPlace->name }}
@endif
Reports To
@if ($user->reportsTo) {{ $user->reportsTo->name }} ({{ $user->reportsTo->roles->first()?->name ?? 'N/A' }}) @else Top Level @endif
Direct Reports
@if ($user->subordinates->count() > 0) {{ $user->subordinates->count() }} @else — @endif
@if ($user->subordinates->count() > 0)
Direct Reports ({{ $user->subordinates->count() }})
@foreach ($user->subordinates as $sub) @endforeach
Name Role Email Status
{{ $sub->name }} {{ ucwords(str_replace('_', ' ', $sub->roles->first()?->name ?? 'N/A')) }} {{ $sub->email }} {{ ucfirst($sub->status) }} View
@endif @php $assignedCustomers = $user->assignedCustomers()->with('projects')->get(); @endphp @if ($assignedCustomers->count() > 0)
Assigned Customers & Projects ({{ $assignedCustomers->count() }})
@foreach ($assignedCustomers as $customer) @endforeach
Customer Name Contact Projects Customer Status
{{ $customer->name }}
{{ $customer->email }}
{{ $customer->phone ?? '—' }}
@if ($customer->projects->count() > 0)
@foreach ($customer->projects as $proj)
{{ $proj->project_code }} {{ ucfirst(str_replace('_', ' ', $proj->status)) }}
@endforeach
@else — @endif
{{ ucfirst($customer->status) }} View
@else
@endif @php $teamProjects = $user->teamMemberships()->with('project')->get(); @endphp @if ($teamProjects->count() > 0)
Working On (Team Member) - {{ $teamProjects->count() }} Projects
@foreach ($teamProjects as $membership) @php $project = $membership->project; @endphp @endforeach
Project Code Project Name Customer Status Role
{{ $project->project_code }} {{ $project->project_name }} {{ $project->customer?->name ?? '—' }} {{ ucfirst(str_replace('_', ' ', $project->status)) }} {{ ucfirst($membership->role ?? 'Team Member') }} View
@else @if ($assignedCustomers->count() === 0)
@endif @endif @endsection