change the date format in laravel view page

Solutions on MaxInterview for change the date format in laravel view page by the best coders in the world

showing results for - "change the date format in laravel view page"
María Alejandra
27 Jun 2016
1// date('d-m-Y', strtotime($user->from_date));
2
3public function convertDate($date,$format = 'd-m-Y'){
4	return date($format, strtotime($date));
5}
6or
7public function convertDate($date,$format = 'd/m/Y'){
8        return \Carbon\Carbon::parse($date)->format($format);
9}
10$user->convertDate($user->from_date);
11//$user->convertDate($user->from_date,'Y-m-d'); with format 
12
13