header('HX-Request')) { return response('', 200)->header('HX-Redirect', route('hr.payrolls.index')); } if (! in_array(auth()->user()->name, self::ALLOWED_PAYROLL_USERS)) { return view('hr.payrolls.restricted'); } $stats = $this->payrollService->getMonthlyStats(); $departments = $this->payrollService->getDepartments(); $employees = $this->payrollService->getActiveEmployees(); $settings = $this->payrollService->getSettings(); $statusMap = Payroll::STATUS_MAP; return view('hr.payrolls.index', [ 'stats' => $stats, 'departments' => $departments, 'employees' => $employees, 'settings' => $settings, 'statusMap' => $statusMap, ]); } }