📜  使用 cast 从 datetime 到 dmY laravel 的日期转换 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:00.385000             🧑  作者: Mango

代码示例1
/**
* 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'
];