getActivitylogOptions() has to be implemented on every models that uses LogsActivity trait #1063
Unanswered
acgtwentyone
asked this question in
Ideas
Replies: 2 comments 3 replies
-
I know this is an old thread but I just bumped into this and the decision to make us implement the abstract method in each model is really weird... I'd love to know the reasoning for it |
Beta Was this translation helpful? Give feedback.
1 reply
-
The documentation on this link cannot be found https://spatie.be/docs/laravel-activitylog/v4/advanced-usage/logging-model-events |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
"The trait contains an abstract method getActivitylogOptions() that you can use to customize options. It needs to return a LogOptions instance built from LogOptions::defaults()" as mentioned on the docs
Let's say i have thousand of models and just upgrade to from version 3 to version 4.
And then i run
composer dump-autoload
The results is something like that:
See ?
In this case i solved this by adding those lines of code:
And then
But with this approach i had to add those line of code on all of my models that were using this
use LogsActivity
which may seems to be a better approach.List of my models (a few of them actually):
So i think the
getActivitylogOptions
abstract method should be revised.Beta Was this translation helpful? Give feedback.
All reactions