feat: update LeaveRequest status check to use LeaveRequestStatus enum
This commit is contained in:
parent
74a76168ab
commit
5e07a1b910
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Requests\Admin\HR;
|
||||
|
||||
use App\Enums\LeaveRequestStatus;
|
||||
use App\Models\LeaveRequest;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
@ -31,7 +32,7 @@ function ($attribute, $value, $fail) use ($leaveRequest) {
|
||||
|
||||
$query = LeaveRequest::where('employee_id', $employee->id)
|
||||
->where('start_date', $value)
|
||||
->where('status', '!=', LeaveRequest::cancelled());
|
||||
->where('status', '!=', LeaveRequestStatus::CANCELLED);
|
||||
|
||||
if ($leaveRequest) {
|
||||
$query->where('id', '!=', $leaveRequest->id);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user