Skip to content

Commit

Permalink
override user defined pivot accessor with default
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-everly committed Apr 6, 2023
1 parent 820b14a commit de187f0
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 de187f0

Please sign in to comment.