Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Texas's avatar

Double date validation in laravel 5

I have a StartDate field and a EndDate field. Both may start today or in the future. It is possible to have them both start on the same day, including today. I have to make a validation for these. What I've done so far is this:

'StartDate'=>'required|date_format:Y/m/d|after:yesterday',
'EndDate'  => 'date_format:Y/m/d|after:yesterday',

What I don't know how to do is to validate true if both dates are equal as a second condition.

Anyone can help me, please ?

0 likes
0 replies

Please or to participate in this conversation.