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

StackBoot's avatar

How to validate date in laravel

I have two arrays in my request:

from = ["Dec 24,2017",.....]
to   = ["Dec 21,2017",....] 


And I have added rules in Laravel Validator for them

'from.*' => 'required',
'to.*' => 'required',


But now I have to add a new validation rule. The first element in "from" must be less than or equal to first element in "to", and respectively for other elements in the arrays.


from[0] <= to[0];
from[1] <= to[1];```

0 likes
0 replies

Please or to participate in this conversation.