datetime formate in laravel migration code example
Example 1: datetime format laravel
//laravel method 1
{{ $data->created_at->isoFormat('dddd D') }}
//laravel method 2
{!! date('d/M/y', strtotime($data->created_at)) !!}
Example 2: datetime-local laravel migration data type
public function getDateStartAttribute($value)
{
return Carbon::parse($value)->format('Y-m-d\TH:i');
}
public function getDateEndAttribute($value)
{
return Carbon::parse($value)->format('Y-m-d\TH:i');
}