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