lundi 14 décembre 2015

Laravel date not allowing me to use diffForHumans

have my table set up with a timestamp fields for created and updated at fields.

In my model I then do this:

protected $dates = ['created_at', 'updated_at'];

But when calling the date:

$p->created_at->diffForHumans()

I get

Call to a member function diffForHumans() on string

I'm pretty sure that should work. I have used the same many times before on different models etc but this just won't work.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire