Skip to content

Can I "extend" Activity model to use a Trait? #959

Answered by Gummibeer
hmaesta asked this question in General
Discussion options

You must be logged in to vote

You can extend it without writing your whole own model.

class MyActivity extends SpatieActivity
{
    use DateTrait;

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

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@hmaesta
Comment options

@tinusg
Comment options

Answer selected by hmaesta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants