Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

yougotnet's avatar

Date not Carbon object

I have a simple model 'Email' with a timestamp field 'sendlater'.

I've add protected $dates = ['sendlater'] but when I retrieve a record or model binding it is not presenting the date as a Carbon object.

Any suggestions?

0 likes
3 replies
trungtranqn91's avatar

share your model pls ! did you add

 public $timestamps = true; 

on your model?

yougotnet's avatar

I tried the public $timestamps = true and no change.

Here is the model:

class Email extends Model { protected $table = 'emails'; protected $guarded = ['id']; protected $dates = ['sendlater']; public $timestamps = true; }

yougotnet's avatar

Also, even the created_at and updated_at are not returning as Carbon instances.

Please or to participate in this conversation.