Support the ongoing development of →
Requests Forms Validation
Last updated 1 year ago.

are you validating during a store or an update? if you're validating during a store, the created_at value is not being passed as a form variable. you can add it as hidden form field then this "should" work

'expected_at' => 'date|after:created_at',

if it's during an update, you need to get the record to check against.

$opportunity= Opportunity::find($id);

$rules['expected_at'] = 'date|after:'.$opportunity->created_at;

then that "should" work. according to docs

 The dates will be passed into the PHP strtotime function.

so it should support datetime format.


Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.