If it is not already a Carbon instance, convert it on the model using the $dates property. Once it is a Carbon instance, then in your view:
{{ $date->format('d/m/Y') }}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I need to show the date extracted from a database from a model in a controller and sent to the view. The format that is given to me is the following: "2018-02-02 00: 00: 00.000". And I need it to look like this: "02/02/2018". I do not want to use hard code in the view.
Total Thanks!
Please or to participate in this conversation.