Laravel Eloquent - date attributes not being retrieved as Carbon objects

Viewed 10988

I've got my $dates attribute on a Quota Eloquent model like this:

protected $dates = ['start', 'end'];

When retrieving data from the DB, those fields are not being set as Carbon instances, but strings instead. Same happens to created_at and updated_at properties.

Any ideas what could be happening? I'm using TIMESTAMPS fields on a MySQL DB and Laravel version is 5.2.

3 Answers
Related