Level 88
Then you need to require them both or you can create your own custom validation rule for this ;)
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How can i validate start date less then end date.Currently i have
public function rules()
{
$endDate = $this->get('end_date');
return [
'start_date' => 'required|date|before:end_date',
'end_date' => 'date|after:start_date',
];
}
It gives validation message like this The start date must be a date before end date.But my end date can be empty.
Please or to participate in this conversation.