Implement HR Branch isolation and Shift isolation
This commit is contained in:
@@ -57,7 +57,7 @@ class LeaveApplicationController extends Controller
|
||||
if (Auth::user()->can('manage-any-leave-applications')) {
|
||||
$q->whereIn('created_by', getCompanyAndUsersId());
|
||||
} elseif (Auth::user()->can('manage-leave-applications')) {
|
||||
$branchId = Auth::user()->employee->branch_id ?? null;
|
||||
$branchId = Auth::user()->branch_id ?? Auth::user()->employee->branch_id ?? null;
|
||||
if ($branchId) {
|
||||
$q->whereHas('employee.employee', function ($eq) use ($branchId) {
|
||||
$eq->where('branch_id', $branchId);
|
||||
|
||||
Reference in New Issue
Block a user