Customize the actions method name from CausesActivity Trait #840
-
Hi, It would be nice if we could customize the name of the actions in the CausesActivity trait because, for examples, if our models already have an attributes actions, it will overwrite the trait instead making it impossible to use. From the doc: https://spatie.be/docs/laravel-activitylog/v3/advanced-usage/logging-model-events#using-the-causesactivity-trait Model (example to illustrate the issue):
Let me know if there is a workaround that I missed too! Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey, there's no way to have dynamic methods. But it's only this relationship - so you can copy it and add your own name. |
Beta Was this translation helpful? Give feedback.
Hey,
there's no way to have dynamic methods. But it's only this relationship - so you can copy it and add your own name.
We don't use this method name internally - the trait is only a helper you can but don't have to use.