-
Is there an opposite to the CausesActivity trait? The documentation shows on how you can log an activity and then request it using the CausesActivity trait. However, is this also possible when starting from the model (i.e. newsarticle)? Thanks for creating this package, and the many other Spatie packages, they are amazing, piece by piece. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey, the trait included is the If you only want the relationship just copy the relationship method. public function activities(): MorphMany
{
return $this->morphMany(ActivitylogServiceProvider::determineActivityModel(), 'subject');
} |
Beta Was this translation helpful? Give feedback.
Hey, the trait included is the
Spatie\Activitylog\Traits\LogsActivity
one which also provides automatic model change logging.https://spatie.be/docs/laravel-activitylog/v3/advanced-usage/logging-model-events
If you only want the relationship just copy the relationship method.