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

vincent15000's avatar

Check for date greater than other date in form request

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

0 likes
1 reply
vincent15000's avatar
vincent15000
OP
Best Answer
Level 63

I just found the solution : I have to use after instead of gt.

Please or to participate in this conversation.