@@ -711,17 +711,17 @@ public function auditDetach(string $relationName, $ids = null, $touch = true, $c
711711 }
712712
713713 $ old = $ relationCall ->get ($ columns );
714-
714+
715715 $ pivotClass = $ relationCall ->getPivotClass ();
716-
716+
717717 if ($ pivotClass !== Pivot::class && is_a ($ pivotClass , ContractsAuditable::class, true )) {
718718 $ results = $ pivotClass ::withoutAuditing (function () use ($ relationCall , $ ids , $ touch ) {
719719 return $ relationCall ->detach ($ ids , $ touch );
720720 });
721721 } else {
722722 $ results = $ relationCall ->detach ($ ids , $ touch );
723723 }
724-
724+
725725 $ new = $ relationCall ->get ($ columns );
726726
727727 $ this ->dispatchRelationAuditEvent ($ relationName , 'detach ' , $ old , $ new );
@@ -742,16 +742,17 @@ public function auditSync(string $relationName, $ids, $detaching = true, $column
742742 {
743743 $ this ->validateRelationshipMethodExistence ($ relationName , 'sync ' );
744744
745+ /** @var BelongsToMany<Model, $this>|\Illuminate\Database\Eloquent\Relations\MorphToMany<Model, $this> $relationCall */
745746 $ relationCall = $ this ->{$ relationName }();
746747
747748 if ($ callback instanceof \Closure) {
748749 $ this ->applyClosureToRelationship ($ relationCall , $ callback );
749750 }
750751
751752 $ old = $ relationCall ->get ($ columns );
752-
753+
753754 $ pivotClass = $ relationCall ->getPivotClass ();
754-
755+
755756 if ($ pivotClass !== Pivot::class && is_a ($ pivotClass , ContractsAuditable::class, true )) {
756757 $ changes = $ pivotClass ::withoutAuditing (function () use ($ relationCall , $ ids , $ detaching ) {
757758 return $ relationCall ->sync ($ ids , $ detaching );
0 commit comments