@extends('admin.admin_dashboard') @section('admin')
Users Org chart All users
@unless($canViewFull) You are viewing your reporting line only — yourself and staff who report to you (directly or indirectly). Managers and colleagues outside your branch are hidden. Contact a Super Admin to update line managers or department heads. @endunless @if($canViewFull && ($stats['without_manager'] ?? 0) > 0 && $canManage) {{ $stats['without_manager'] }} staff have no line manager — requisitions from them skip straight to HOD approval. @endif @unless($canManage || $canManageDepartments) You have view-only access. Only a Super Admin can assign line managers, department heads, and ministry supervisors. @endunless
@if(empty($tree)) @else
{{ max(1, $maxDepth + 1) }}
@if(($stats['issue_count'] ?? 0) > 0) @endif
Zoom 100%
Recent
Top-level HOD Dept head Reporting path My team Drag background to pan · Scroll to zoom area
    @foreach($tree as $node) @include('admin.administration.org_chart.partials.chart-node', [ 'node' => $node, 'departmentHeadIds' => $departmentHeadIds, 'canManage' => $canManage, ]) @endforeach
@endif
@if($canViewFull) @include('admin.administration.org_chart.partials.external-users') @endif
@include('admin.administration.org_chart.partials.directory') @include('admin.administration.org_chart.partials.insights') @if($canManage)

Search and select managers with Select2. Changes affect requisition email routing immediately.

@foreach($allUsers as $user) @endforeach
Staff member Reports to Department
{{ $user->name }}
{{ $user->primaryRoleName() }}
@csrf
@endif @if($canManageDepartments)

Set the department head (HOD) and ministry supervisor for final requisition approval. Senior approval goes to the HOD's line manager when configured, otherwise the ministry supervisor.

@foreach($allDepartments as $department) @php $seniorMeta = $departmentSeniorMeta[$department->id] ?? null; @endphp
@csrf
{{ $department->name }}
@if($department->headUser)
{{ $department->headUser->name }} @if($department->headUser->manager) · reports to {{ $department->headUser->manager->name }} @else · no line manager @endif
@endif @if($department->ministrySupervisor)
{{ $department->ministrySupervisor->name }}
@endif @if($seniorMeta)
Senior approval route
@if($seniorMeta['users']->isNotEmpty()) @foreach($seniorMeta['users'] as $approver)
{{ $approver->name }}
@endforeach @if(!empty($seniorMeta['subtitle']))
{{ $seniorMeta['subtitle'] }}
@endif @else
No senior approver configured
@endif
@endif
@endforeach
@endif
@endsection @push('scripts') @php $orgChartConfig = [ 'currentUserId' => $currentUserId, 'focusUserId' => $focusUserId, 'canManage' => $canManage, 'canViewFull' => $canViewFull, 'staffMeta' => $staffMeta, 'flatDirectory' => $flatDirectory, 'maxDepth' => $maxDepth, 'issues' => $issues, 'userOptions' => $users->map(fn ($u) => ['id' => $u->id, 'name' => $u->name])->values()->all(), 'editUserRoute' => route('edit.user', ['id' => '__ID__']), 'updateManagerRoute' => url('/staff/org-chart/users/__USER__/manager'), 'csrfToken' => csrf_token(), ]; @endphp @endpush