fix: eager load branch on correct relation
This commit is contained in:
@@ -31,7 +31,7 @@ class AttendanceRecordController extends Controller
|
||||
}
|
||||
|
||||
if (Auth::user()->can('manage-attendance-records')) {
|
||||
$query = AttendanceRecord::with(['employee.branch', 'shift', 'attendancePolicy', 'creator'])
|
||||
$query = AttendanceRecord::with(['employee.employee.branch', 'shift', 'attendancePolicy', 'creator'])
|
||||
->where(function ($q) {
|
||||
if (Auth::user()->can('manage-any-attendance-records')) {
|
||||
$q->whereIn('created_by', getCompanyAndUsersId());
|
||||
|
||||
Reference in New Issue
Block a user