I have in model:
protected $casts = [
'date' => 'date',
];
Does laravel have some ability to set cast format, something like:
protected $casts = [
'date' => 'date_format:d/m/yyyy',
];
?
EDITED
I tried this:
In model:
protected $dateFormat = 'm/d/Y';
protected $dates = ['driver_expiration', 'created_at', 'updated_at', 'deleted_at'];
protected $casts = [
'driver_expiration' => 'date',
];
I saved date(driver_expiration) as '01/012016' but date is saved 0000-00-00.
laravel documentation: https://laravel.com/docs/5.1/eloquent-mutators Tell us $dateFormat works only for timestamps ('created_at', 'updated_at', 'deleted_at')