I am trying to change date format while fetching data in this way
protected $casts = [
'due_date' => 'date:d-m-Y',
];
Blade
{{$ticket->due_date}}
It is showing is like
2022-03-13
I am trying to change date format while fetching data in this way
protected $casts = [
'due_date' => 'date:d-m-Y',
];
Blade
{{$ticket->due_date}}
It is showing is like
2022-03-13
Copyright © 2021 Jogjafile Inc.
Casts are for json serialization (
json_encode($ticket)
). To get the format you want in blade, useCarbon
'sformat
method.