Laravel and the formatting of dates


Gentlemen I am making a query to a table with Eloquent ... and between the fields that I want to consult this one of date, as I do so that in full consultation to bring the date formatted? Ex:


I am looking for the date field but it is in mm-dd-yyyy, I want to present it as dd-mm-yyyy as it is done?

asked by jose angarita 20.02.2018 в 15:04

1 answer


The dates in Laravel are converted (usually) to Carbon's instances, at least in the recent versions, in theory you should simply use the format() method in the Carbon instance, that is, in the field as such:

answered by 20.02.2018 в 15:18