get rid of the date rule. The docs say to use date or date_format, but not both
May 13, 2017
7
Level 2
Validation: Form input should be greater than literal date value
I have created a Form Request which validates an input labelled start_date. This date needs to be greater than a literal value 2016-06-31.
This is the rule I have build in my form request file:
public function rules()
{
return [
'start_date' => 'required|date|date_format:Y-m-d|after:2017-06-31',
];
}
This is what is sent in my form request
{
"token": "tZa4e39ejrGHtrlpOYrUPfZ8PgSeD8FelY4voKni",
"start_date": "2017-07-01"
}
However I get an error saying "The start date must be a date after 2017-06-31." regardless of what date I put in there.
Please or to participate in this conversation.