Update ShiftController.php

This commit is contained in:
2026-04-20 15:24:01 +08:00
parent 4fba6c39f9
commit 6139093af4

View File

@@ -337,12 +337,12 @@ class ShiftController extends Controller
[
'employee_id' => $validated['employee_id'],
'date' => $date->format('Y-m-d'),
'created_by' => creatorId(),
],
[
'shift_id' => $validated['is_rest_day'] ? null : $validated['shift_id'],
'is_rest_day' => $validated['is_rest_day'] ?? false,
'status' => $validated['is_rest_day'] ? 'absent' : 'present', // Default status for scheduled shift
'created_by' => creatorId(),
]
);
}