add end_km to violations

This commit is contained in:
2026-06-15 10:32:04 +03:30
parent 1be9315b73
commit 439f69af29
5 changed files with 53 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ class UpdateRequest extends FormRequest
{
return [
'enter_time' => 'required|date',
'end_km'=> 'required|string',
];
}
@@ -40,6 +41,12 @@ class UpdateRequest extends FormRequest
'زمان پایان ماموریت باید بعد از زمان شروع ماموریت باشد.'
);
}
if ($this->end_km < $this->violation->km) {
$validator->errors()->add(
'end_km',
'کیلومتر پایان باید بزرگتر از کیلومتر شروع باشد.'
);
}
}
];
}