xxxxxxxxxx
{{ date('d-m-Y', strtotime($project->start_date)) }}
{{ date('d-m-Y h:i:s', strtotime($project->start_date)) }}
{{ date('h:i:s', strtotime($project->start_date)) }}
{{ (strtotime($project->start_date) < time()) ? 'text-danger' : '' }}
xxxxxxxxxx
// in model
protected $casts = [
'date_of_approval' => 'date:d-m-Y'
];
// if you want change format any where
$appointment->date_of_approval->format('Y-m-d');
// if you have not cast in model data format
Carbon\Carbon::parse($appointment->date_of_approval)->format('Y-m-d');
xxxxxxxxxx
$user = \App\User::find(1);
$newDateFormat = $user->created_at->format('d/m/Y');
dd($newDateFormat);
xxxxxxxxxx
{{ $post->created_at->diffForHumans() }}
/*
//Output
Arya Stuck 14 minutes ago
Post something
Mizan Khan 23 hours ago
Post something
*/