|
1025 | 1025 | // Create the schedule object without saving to check conflicts |
1026 | 1026 | // Use the same approach as ValidationService |
1027 | 1027 | $tempSchedule = new Schedule([ |
1028 | | - 'schedulable_type' => get_class($user), |
| 1028 | + 'schedulable_type' => $user->getMorphClass(), |
1029 | 1029 | 'schedulable_id' => $user->getKey(), |
1030 | 1030 | 'start_date' => $newSchedule['attributes']['start_date'], |
1031 | 1031 | 'end_date' => $newSchedule['attributes']['end_date'] ?? null, |
|
1071 | 1071 |
|
1072 | 1072 | // Create the schedule object without saving to check conflicts |
1073 | 1073 | $tempSchedule = new Schedule($schedule['attributes']); |
1074 | | - $tempSchedule->schedulable_type = get_class($user); |
| 1074 | + $tempSchedule->schedulable_type = $user->getMorphClass(); |
1075 | 1075 | $tempSchedule->schedulable_id = $user->getKey(); |
1076 | 1076 | $tempSchedule->setRelation('periods', collect($schedule['periods'])->map(function ($period) { |
1077 | 1077 | return new \Zap\Models\SchedulePeriod($period); |
|
1101 | 1101 | // Create the schedule object without saving to check conflicts |
1102 | 1102 | // Use the same approach as ValidationService |
1103 | 1103 | $tempSchedule = new Schedule([ |
1104 | | - 'schedulable_type' => get_class($user), |
| 1104 | + 'schedulable_type' => $user->getMorphClass(), |
1105 | 1105 | 'schedulable_id' => $user->getKey(), |
1106 | 1106 | 'start_date' => $newSchedule['attributes']['start_date'], |
1107 | 1107 | 'end_date' => $newSchedule['attributes']['end_date'] ?? null, |
|
1148 | 1148 | // Create the schedule object without saving to check conflicts |
1149 | 1149 | // Use the same approach as ValidationService |
1150 | 1150 | $tempSchedule = new Schedule([ |
1151 | | - 'schedulable_type' => get_class($user), |
| 1151 | + 'schedulable_type' => $user->getMorphClass(), |
1152 | 1152 | 'schedulable_id' => $user->getKey(), |
1153 | 1153 | 'start_date' => $newSchedule['attributes']['start_date'], |
1154 | 1154 | 'end_date' => $newSchedule['attributes']['end_date'] ?? null, |
|
0 commit comments