Can you just do:
'end_at' => 'required|date|date_format:Y-m-d|after:start_at',
Otherwise I think you can put the start_at date in a variable and pass that in instead.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How do I validate a date in such a way that it only accepts a date which is same asa given date, or older than that.
$rules = [
'start_at' => 'required|date|date_format:Y-m-d|after:yesterday',
'end_at' => 'required|date|date_format:Y-m-d|after:xxxx',
];
xxxx represent the validation I want to perform. I want to be able to start a task today or any day in the future and be able to set the ending date to the same as starting date or older than that.
Logically, the ending date must be greater or equal to the starting date.
Please or to participate in this conversation.