Support the ongoing development of →
Database Views
Last updated 3 months ago.

Laravel is using Carbon to manage datetime fields in database. By default, updated_at and created_at fields are automatically converted to a Carbon instance when retrieved, that's why you get the error on date() function.

To display the date, you have two options:

{{ $object->created_at }} // Will call toString() on object

// or

{{ $object->created_at->format('d M Y - H:i:s') }} // Format date to desired format

Carbon is a powerfull library to manage date. To learn more, see


Hi MateusAzevedo

Thanks. I just realised I was being incredibly blonde trying to use date() to format the created_at value to the same format it's already in. I blame my lack of coffee today.


Sign in to participate in this thread!


Your banner here too?

VenomRush VenomRush venomrush Joined 27 May 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 - All rights reserved.