I am trying to show the date in laravel with a specific format using $casts in my model, but when I show in the view I get an error
Call to undefined method DateTime :: getTimezone ()
and I do not know why this error is due.
Model
class Category extends Model
{
use SoftDeletes;
protected $dates = [ 'created_at','updated_at','deleted_at'];
protected $casts = [
'created_at' => 'datetime:d-M-Y H:i:s',
'updated_at' => 'datetime:d-M-Y H:i:s',
'deleted_at' => 'datetime:d-M-Y H:i:s'
];
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire