Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

date casting from datetime to d-m-Y laravel

/**
* 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'
];
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #date #casting #datetime #laravel
ADD COMMENT
Topic
Name
5+3 =