date casting from datetime to d-m-Y laravel using cast

141

date casting from datetime to d-m-Y laravel using cast -

/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
   'created_at' => 'datetime:Y-m-d',
   'updated_at' => 'datetime:Y-m-d',
   'deleted_at' => 'datetime:Y-m-d h:i:s'
];

Comments

Submit
0 Comments