Create audit for a pivot table change #927
-
I have client model that have a pivot called patients which is connecting User model with the following code: public function patients() {
return $this->belongsToMany('App\Models\User' , 'client_patient' , 'client_id', 'patient_id')
->withPivot(
'name', 'first_name', 'last_name', 'email', 'social_id', 'phone', 'age', 'dateOfBirth',
'address', 'city', 'gender', 'hmo', 'insurance', 'can_edit', 'verified', 'archive'
)
->withTimestamps();
} I want to know how can I add an audit on the pivot table each time that is been created or updated? |
Beta Was this translation helpful? Give feedback.
Answered by
parallels999
May 13, 2024
Replies: 1 comment 7 replies
-
Did you try audit-custom.html#example-related-attributes? |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
erikn69
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you try audit-custom.html#example-related-attributes?
Also take a look at #921, 9207868, fa10bfe