@extends('adminlte::page') @section('title', 'Dashboard') @include('partials.ui-polish') @section('content_header')

HR & Payroll Dashboard

Today’s people operations, approvals, compliance, and payroll readiness
@if($activeModuleCodes->contains('leave_management') && Illuminate\Support\Facades\Gate::allows('hrm.view')) Absence Calendar @endif @if($activeModuleCodes->contains('project_management') && Illuminate\Support\Facades\Gate::allows('projects.view')) Projects @endif @if($activeModuleCodes->contains('payroll') && Illuminate\Support\Facades\Gate::allows('payroll.process')) Payroll Runs @endif
@stop @section('content') @php $can = fn (string $ability) => Illuminate\Support\Facades\Gate::allows($ability); $moduleIsActive = fn (string $module) => $activeModuleCodes->contains($module); $canSeeLeaveStartingSoon = $moduleIsActive('leave_management') && ($can('hrm.manage') || $can('hrm.attendance.manage')); $workQueueCount = ($moduleIsActive('leave_management') && $can('hrm.leave.supervisor-approve') ? $pendingLeaveRequests->count() : 0) + ($moduleIsActive('leave_management') && $can('hrm.leave.approve') ? $finalApprovalLeaveRequests->count() : 0) + ($canSeeLeaveStartingSoon ? $leaveStartingSoon->count() : 0) + ($moduleIsActive('timesheet_management') && $can('hrm.timesheets.manage') ? $pendingTimesheets->count() : 0) + ($moduleIsActive('payroll') && $can('payroll.process') ? $openPayrollRuns->count() : 0) + ($moduleIsActive('advance_retirement') && $can('advance.view') ? $metrics['pendingAdvances'] : 0) + ($moduleIsActive('hr_management') && $can('hrm.manage') ? $expiringContracts->count() : 0) + ($moduleIsActive('hr_management') && $can('hrm.manage') ? $expiringDocuments->count() : 0) + ($moduleIsActive('payroll') && $can('payroll.manage') ? $salaryGradeAlerts->count() : 0) + ($moduleIsActive('hr_management') && $can('hrm.manage') ? $upcomingHolidays->count() : 0); $moduleCards = [ [ 'title' => 'Platform', 'subtitle' => 'Tenants, plans, subscriptions', 'icon' => 'fas fa-globe', 'theme' => 'dark', 'metric' => $metrics['organizations'], 'metricLabel' => 'organizations', 'ability' => 'platform.manage', 'url' => route('admin.organizations.index'), 'actions' => [ ['label' => 'Organizations', 'url' => route('admin.organizations.index'), 'ability' => 'platform.manage'], ['label' => 'Users', 'url' => route('admin.users.index'), 'ability' => 'users.manage'], ], ], [ 'title' => 'People', 'subtitle' => 'Employees, contracts, documents', 'icon' => 'fas fa-user-friends', 'theme' => 'primary', 'metric' => $metrics['activeEmployees'], 'metricLabel' => 'active staff', 'ability' => 'hrm.manage', 'module' => 'hr_management', 'url' => route('hrm.employees.index'), 'actions' => [ ['label' => 'Employees', 'url' => route('hrm.employees.index'), 'ability' => 'hrm.manage', 'module' => 'hr_management'], ['label' => 'Contracts', 'url' => route('hrm.contracts.index'), 'ability' => 'hrm.manage', 'module' => 'hr_management'], ['label' => 'Documents', 'url' => route('hrm.documents.index'), 'ability' => 'hrm.manage', 'module' => 'hr_management'], ], ], [ 'title' => 'Leave & Time', 'subtitle' => 'Absences, attendance, timesheets', 'icon' => 'fas fa-calendar-check', 'theme' => 'success', 'metric' => $metrics['pendingLeave'] + $metrics['submittedTimesheets'], 'metricLabel' => 'items pending', 'ability' => 'hrm.view', 'module' => 'leave_management', 'url' => route('hrm.leave-requests.index'), 'actions' => [ ['label' => 'Leave', 'url' => route('hrm.leave-requests.index'), 'ability' => 'hrm.leave.request', 'module' => 'leave_management'], ['label' => 'Attendance', 'url' => route('hrm.attendance.index'), 'ability' => 'hrm.attendance.manage', 'module' => 'timesheet_management'], ['label' => 'Timesheets', 'url' => route('hrm.timesheets.index'), 'ability' => 'hrm.timesheets.manage', 'module' => 'timesheet_management'], ], ], [ 'title' => 'Payroll', 'subtitle' => 'Salary setup, runs, payslips', 'icon' => 'fas fa-money-check-alt', 'theme' => 'info', 'metric' => $metrics['activeSalaries'], 'metricLabel' => 'salary records', 'ability' => 'payroll.payslip.view-own', 'module' => 'payroll', 'url' => route('payroll.runs.index'), 'actions' => [ ['label' => 'Setup', 'url' => route('payroll.salary-setup.index'), 'ability' => 'payroll.manage', 'module' => 'payroll'], ['label' => 'Runs', 'url' => route('payroll.runs.index'), 'ability' => 'payroll.process', 'module' => 'payroll'], ['label' => 'Payslips', 'url' => route('payroll.payslips.index'), 'ability' => 'payroll.payslip.view-own', 'module' => 'payroll'], ], ], [ 'title' => 'Advance & Retirement', 'subtitle' => 'Requests, payments, settlements', 'icon' => 'fas fa-hand-holding-usd', 'theme' => 'teal', 'metric' => $metrics['pendingAdvances'], 'metricLabel' => 'pending requests', 'ability' => 'advance.view', 'module' => 'advance_retirement', 'url' => route('advance-retirement.index'), 'actions' => [ ['label' => 'Requests', 'url' => route('advance-retirement.index'), 'ability' => 'advance.view', 'module' => 'advance_retirement'], ['label' => 'Pending', 'url' => route('advance-retirement.index'), 'ability' => 'advance.view', 'module' => 'advance_retirement'], ['label' => 'Retirement', 'url' => route('advance-retirement.index', ['status' => 'Partially Retired']), 'ability' => 'advance.view', 'module' => 'advance_retirement'], ], ], [ 'title' => 'Projects', 'subtitle' => 'Donors, budgets, work plans', 'icon' => 'fas fa-project-diagram', 'theme' => 'success', 'metric' => $metrics['activeProjects'], 'metricLabel' => 'active projects', 'ability' => 'projects.view', 'module' => 'project_management', 'url' => route('projects.index'), 'actions' => [ ['label' => 'Dashboard', 'url' => route('projects.index'), 'ability' => 'projects.view', 'module' => 'project_management'], ['label' => 'Budgets', 'url' => route('projects.index', ['section' => 'budgets']), 'ability' => 'projects.view', 'module' => 'project_management'], ['label' => 'Activities', 'url' => route('projects.index', ['section' => 'activities']), 'ability' => 'projects.view', 'module' => 'project_management'], ], ], [ 'title' => 'Configuration', 'subtitle' => 'Leave rules, holidays, grades', 'icon' => 'fas fa-sliders-h', 'theme' => 'warning', 'metric' => $upcomingHolidays->count(), 'metricLabel' => 'holidays soon', 'ability' => 'hrm.manage', 'module' => 'hr_management', 'url' => route('hrm.configuration.index'), 'actions' => [ ['label' => 'HR Config', 'url' => route('hrm.configuration.index'), 'ability' => 'hrm.manage', 'module' => 'hr_management'], ['label' => 'Structure', 'url' => route('hrm.structure.index'), 'ability' => 'hrm.manage', 'module' => 'hr_management'], ['label' => 'Users', 'url' => route('admin.users.index'), 'ability' => 'users.manage', 'module' => 'hr_management'], ], ], ]; $moduleCards = collect($moduleCards) ->filter(fn ($card) => Illuminate\Support\Facades\Gate::allows($card['ability']) && (empty($card['module']) || $moduleIsActive($card['module']))) ->map(function ($card) use ($moduleIsActive) { $card['actions'] = collect($card['actions']) ->filter(fn ($action) => Illuminate\Support\Facades\Gate::allows($action['ability']) && (empty($action['module']) || $moduleIsActive($action['module']))) ->values() ->all(); return $card; }) ->values(); @endphp @push('css') @endpush
Operational Focus

Keep approvals, absences, compliance, and payroll moving.

@can('hrm.manage') {{ $metrics['activeEmployees'] }} active staff, @endcan @can('hrm.attendance.manage') {{ $metrics['attendanceToday'] }} attendance records today, @endcan {{ $workQueueCount }} open signals.
Work Queue
{{ $workQueueCount }}
open signals
@can('users.manage') @if($organization)
{{ $organization->plan }} {{ $organization->subscription_status }} {{ $organization->billing_status }} @if($organization->subscription_ends_at) Ends {{ $organization->subscription_ends_at->format('M d, Y') }} @endif
View Details
@foreach($organization->modules as $module) @php $isActive = in_array($module->pivot->status, ['Active', 'Trial'], true) && (! $module->pivot->expires_at || \Illuminate\Support\Carbon::parse($module->pivot->expires_at)->isFuture()); @endphp
{{ $module->name }} {{ $module->pivot->status }}
@endforeach
@endif @endcan
@if($moduleIsActive('hr_management') && $can('hrm.manage'))
@endif @if($moduleIsActive('timesheet_management') && $can('hrm.attendance.manage'))
@endif @if($moduleIsActive('leave_management') && $can('hrm.leave.request'))
@endif @if($moduleIsActive('leave_management') && $can('hrm.leave.approve'))
@endif
@if($moduleIsActive('hr_management') && $can('hrm.manage'))
@endif @if($moduleIsActive('payroll') && $can('payroll.manage'))
@endif @if($moduleIsActive('payroll') && $can('payroll.payslip.view-own'))
@endif @if($moduleIsActive('hr_management') && $can('hrm.manage'))
@endif
@foreach($moduleCards as $card)
{{ $card['subtitle'] }}
{{ $card['title'] }}
{{ $card['metric'] }}
{{ $card['metricLabel'] }}
@endforeach
@if($moduleIsActive('leave_management') && $can('hrm.leave.supervisor-approve')) @foreach($pendingLeaveRequests as $leave) @endforeach @endif @if($moduleIsActive('leave_management') && $can('hrm.leave.approve')) @foreach($finalApprovalLeaveRequests as $leave) @endforeach @endif @if($canSeeLeaveStartingSoon) @foreach($leaveStartingSoon as $leave) @endforeach @endif @if($moduleIsActive('timesheet_management') && $can('hrm.timesheets.manage')) @foreach($pendingTimesheets as $timesheet) @endforeach @endif @if($moduleIsActive('payroll') && $can('payroll.process')) @foreach($openPayrollRuns as $run) @endforeach @endif @if($moduleIsActive('hr_management') && $can('hrm.manage')) @foreach($expiringContracts as $contract) @endforeach @foreach($expiringDocuments as $document) @endforeach @endif @if($moduleIsActive('payroll') && $can('payroll.manage')) @foreach($salaryGradeAlerts as $salary) @endforeach @endif @if($moduleIsActive('hr_management') && $can('hrm.manage')) @foreach($upcomingHolidays as $item) @endforeach @endif @if($workQueueCount === 0) @endif
Area Item Due / Period Action
Leave {{ $leave->employee->full_name ?? 'Unknown employee' }} - {{ $leave->leaveType->name ?? 'Leave' }} {{ $leave->start_date->format('M d') }} - {{ $leave->end_date->format('M d, Y') }} Open
Final Approval {{ $leave->employee->full_name ?? 'Unknown employee' }} - {{ $leave->leaveType->name ?? 'Leave' }} {{ $leave->start_date->format('M d') }} - {{ $leave->end_date->format('M d, Y') }} Open
Upcoming Leave {{ $leave->employee->full_name ?? 'Unknown employee' }} - {{ $leave->leaveType->name ?? 'Leave' }} Starts {{ $leave->start_date->format('M d, Y') }} Calendar
Timesheet {{ $timesheet->employee->full_name ?? 'Unknown employee' }} - {{ number_format((float) $timesheet->entries->sum('hours_worked'), 2) }} hrs {{ $timesheet->period_start->format('M d') }} - {{ $timesheet->period_end->format('M d, Y') }} Open
Payroll {{ $run->period->name ?? 'Payroll run' }} - {{ $run->status }} {{ number_format((float) $run->net_total, 2) }} net Open
Contract {{ $contract->employee->full_name ?? 'Unknown employee' }} Ends {{ $contract->end_date->format('M d, Y') }} Open
Document {{ $document->employee->full_name ?? 'Unknown employee' }} - {{ $document->title }} @if($document->expires_at->lt(today())) Expired {{ $document->expires_at->format('M d, Y') }} @else Expires {{ $document->expires_at->format('M d, Y') }} @endif Open
Salary Grade {{ $salary->employee->full_name ?? 'Unknown employee' }} - Grade {{ $salary->salary_grade }} {{ number_format((float) $salary->basic_salary, 2) }} Review
Holiday {{ $item['holiday']->name }} {{ $item['next_date']->format('M d, Y') }} Configure
No urgent work items right now.
@if($moduleIsActive('hr_management') && $can('hrm.manage')) Expiring Documents {{ $metrics['documentsExpiring'] }} Upcoming Holidays {{ $upcomingHolidays->count() }} @endif @can('platform.manage') Active Subscriptions {{ $metrics['activeSubscriptions'] }} @endcan @if($moduleIsActive('payroll') && $can('payroll.manage')) Salary Grade Alerts {{ $salaryGradeAlerts->count() }} @endif @if($moduleIsActive('leave_management') && $can('hrm.leave.approve')) Final Leave Approvals {{ $metrics['finalApprovalLeave'] }} @endif @if(! $can('platform.manage') && ! $can('hrm.manage') && ! $can('payroll.manage') && ! $can('hrm.leave.approve'))
No compliance alerts for your role.
@endif
@can('employee.portal') My Self-Service @endcan @can('platform.manage') Organizations @endcan @can('users.manage') @if($moduleIsActive('hr_management')) Users & Roles @endif Subscription & Modules @endcan @if($moduleIsActive('hr_management') && $can('hrm.manage')) Departments & Positions Employees Contracts @endif @if($moduleIsActive('timesheet_management') && $can('hrm.attendance.manage')) Attendance @endif @if($moduleIsActive('leave_management') && $can('hrm.leave.request')) Leave Requests @endif @if($moduleIsActive('timesheet_management') && $can('hrm.timesheets.manage')) Timesheets @endif @if($moduleIsActive('project_management') && $can('projects.view')) Projects @endif @if($moduleIsActive('payroll') && $can('payroll.manage')) Salary Setup @endif @if($moduleIsActive('payroll') && $can('payroll.process')) Payroll Runs @endif @if($moduleIsActive('payroll') && $can('payroll.payslip.view-own')) Payslips @endif @if($moduleIsActive('advance_retirement') && $can('advance.view')) Advance & Retirement @endif @if($moduleIsActive('payroll') && $can('payroll.view')) Reports @endif
@stop