/**
* 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'
];
$myDate = '12/08/2020';
$date = Carbon::createFromFormat('m/d/Y', $myDate)->format('Y/m/d');
$timestamp = $user->created_at->timestamp
laravel convert timestamp to date
date('Y-m-d', strtotime($date));
laravel convert date to timestamp
date('Y-m-d H:i:s', strtotime($date));
Code Example |
---|
Php :: |
Php :: log facade laravel |
:: |
:: |
:: laravel get list of columns in a table |
:: string to float php |
Php :: |
Php :: |
:: laravel foreign key |
:: get today date magento 2 object manager |
Php :: php count number of files in directory |
:: livewire pagination bootstrap |
:: |
:: |
Php :: if name value contains space in php |
:: php nested array contains |
:: laravel generate slug |
Php :: convert string to date php |
:: |
:: php truncate string |
:: make a seeding file in laravel |
Php :: |
:: |
Php :: |
Php :: |
:: |
:: |
Php :: |
Php :: doctrine mongodb native query |
:: |