-
My project uses a Trait to convert dates into user's defined timezone. For every Model that has dates we just need to point this Trait and specify date fields into But all activity logs return dates in UTC – like it should, since I didn't pointed the Trait in model. I know I can overwrite Model path in So, is it possible to ""extend"" this Model from source and add my Trait? use MyTraitName;
protected $dates = [
'created_at',
'updated_at',
]; Ps: Laravel 8 + PHP 7.4 + laravel-activitylog 3.17 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can extend it without writing your whole own model. class MyActivity extends SpatieActivity
{
use DateTrait;
protected $dates = [
'created_at',
'updated_at',
];
} |
Beta Was this translation helpful? Give feedback.
You can extend it without writing your whole own model.