Wrap your format, which should work, I just tried with 5.2 to work fine.
public function rules() { return [ 'title' => 'required|max:255', 'expiration_date' => 'required|date_format:"dmY"', //'description' => 'required', 'provision_agent' => 'required|integer|between:0,100', 'discount_consumer' => 'required|integer|between:0,100', 'quota' => 'required|integer', ]; }
But the error you added to the InvalidArgumentException question in Carbon.php line 425: there seems to be something else, I assume that you are using expiration_date , where in the controller or model like this with Carbon
echo Carbon::createFromFormat('Ym-d', '12.1.2017');
You should try something like this
echo Carbon::parse('12.1.2017')->format('Ym-d')
source share