Skip to content

Commit

Permalink
Merge pull request #56 from ben-everly/master
Browse files Browse the repository at this point in the history
override user defined pivot accessor with default
  • Loading branch information
weotch authored Apr 20, 2023
2 parents 820b14a + de187f0 commit 18fbd1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cloner.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ protected function duplicatePivotedRelation($relation, $relation_name, $clone) {
if ($this->write_connection) return;

// Loop trough current relations and attach to clone
$relation->get()->each(function ($foreign) use ($clone, $relation_name) {
$relation->as('pivot')->get()->each(function ($foreign) use ($clone, $relation_name) {
$pivot_attributes = Arr::except($foreign->pivot->getAttributes(), [
$foreign->pivot->getRelatedKey(),
$foreign->pivot->getForeignKey(),
Expand Down

0 comments on commit 18fbd1c

Please sign in to comment.