Fix LeaveBalanceController query relationship for branch_id
This commit is contained in:
@@ -24,7 +24,7 @@ class LeaveBalanceController extends Controller
|
||||
} elseif (Auth::user()->can('manage-leave-balances')) {
|
||||
$branchId = Auth::user()->employee->branch_id ?? null;
|
||||
if ($branchId) {
|
||||
$q->whereHas('employee', function ($eq) use ($branchId) {
|
||||
$q->whereHas('employee.employee', function ($eq) use ($branchId) {
|
||||
$eq->where('branch_id', $branchId);
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user