Global Auditing #978
IamMuhammadHasib
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I don't think it is possible to listen to model events without modifying the model so I doubt this is possible from this packages perspective. At the very least, it also expects all the relations and methods to be available from the model which requires the two lines added. I know spatie/laravel-permission lets you specify the model so you can always extend their model and add the auditable parts yourself. Unless there is a drastic laravel change, I doubt the two lines you are worried about being changed would ever change. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Normal auditing for a model looks like
For global audit (to audit all my models) I created a
app/Models/BaseModel.php
fileAnd then in my models extending the BaseModel instead of Model
Can you make it a feature?
Also with my method I need to edit all my models to extend BaseModel. It can be problematic for a high number of models. Moreover, some models are created inside packages (e.g.
saptie/laravel-permission
,Auth
), which doesn't work this way. So, I had to do it manually as docs described, which may prone to package update! So, badly in need of a global auditing.Beta Was this translation helpful? Give feedback.
All reactions