I have this, and it works nicely to give me UK-formatted dates:
protected $dateFormat = 'd-m-Y';
protected $dates = ['purchased', 'warranty_expires', 'scrapped_on', 'location_date', 'user_date'];
However, I also have created and modified (not the standard Laravel ones, but my own) that are Timestamps, not dates. How can I automate the formatting of those two fields when they are retrieved, to something like 'd-m-Y H:i:s' ?
You can do this with Carbon library
You have to use carbon class. Write this line in the top where all namespace are used.