From f851f30df5dc5d4eeb2b4d7b9a2d5aa466199f11 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 6 Jul 2026 13:16:00 +0800 Subject: [PATCH] Fallback PayrollRunController to created_by Auth id for branch managers --- app/Http/Controllers/PayrollRunController.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/Http/Controllers/PayrollRunController.php b/app/Http/Controllers/PayrollRunController.php index 664a1c995..2d264efae 100644 --- a/app/Http/Controllers/PayrollRunController.php +++ b/app/Http/Controllers/PayrollRunController.php @@ -18,10 +18,8 @@ class PayrollRunController extends Controller $query = PayrollRun::with(['creator'])->where(function ($q) { if (Auth::user()->can('manage-any-payroll-runs')) { $q->whereIn('created_by', getCompanyAndUsersId()); - } elseif (Auth::user()->can('manage-own-payroll-runs')) { - $q->where('created_by', Auth::id()); } else { - $q->whereRaw('1 = 0'); + $q->where('created_by', Auth::id()); } });