Level 63
I just found the solution : I have to use after instead of gt.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I have tried to check if a date is greater than another date in a form.
'start_date' => 'required|date',
'end_date' => 'required|date|gt:start_date',
The problem is that even the end_date is greater than the start_date, I receive an error saying that the end_date has to be greater than the end_date.
The documentation says that gt evaluates strings, numerics, arrays and files with the size rule, but what about the evaluation of dates ?
How can I compare two dates in a form request ?
Thanks for your help.
V
I just found the solution : I have to use after instead of gt.
Please or to participate in this conversation.