-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does 9.0 supports pivot table auditing #506
Comments
Laravel does not fire eloquent events on pivots in 5.6 so not using the sync() or save() methods on relationships. There is currently an open pull request in Laravel to do update this, but it will not be until Laravel 5.10 that it is likely released. You must do 2 steps instead:
|
@vpillinger there is something on laravel 5.8 here > Intermediate Table / Pivot Model Events will this not help auditing? |
Related #58 |
@jonagoldman so now, if it is dispatching events, in laravel 5.8, we can audit many-to-may relations, right? |
Sorry, it appears that in Laravel 5.8 this was indeed updated. The ticket in the Laravel repo was not closed so I did not realize that this was actually done. When I dived the code in 5.8, I did not see the events firing, but better to trust the documentation :). So all you should need to do is create a custom pivot model and add |
@vpillinger It will not work for me right now, but as I had noticed you, thought to let you know, nothing else. I will try your solution, what I did is generated another table to get everything recorded and using that to create the report, but I will definitely try your solution and let you know. |
v13 supports a way to audit pivots as properties of the auditable itself https://www.laravel-auditing.com/docs/13.0/audit-custom |
Above link is now https://laravel-auditing.com/guide/audit-custom.html |
Actual Behaviour
The text was updated successfully, but these errors were encountered: