Skip to content

Commit

Permalink
Use qualified column names in pivot query (#36720)
Browse files Browse the repository at this point in the history
Co-authored-by: Menzo Wijmenga <[email protected]>
  • Loading branch information
vdlp-mw and Menzo Wijmenga authored Mar 26, 2021
1 parent 07c17d1 commit df0f50a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Eloquent/Relations/Concerns/InteractsWithPivotTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ public function detach($ids = null, $touch = true)
return 0;
}

$query->whereIn($this->relatedPivotKey, (array) $ids);
$query->whereIn($this->getQualifiedRelatedPivotKeyName(), (array) $ids);
}

// Once we have all of the conditions set on the statement, we are ready
Expand Down Expand Up @@ -544,7 +544,7 @@ public function newPivotQuery()
$query->whereIn(...$arguments);
}

return $query->where($this->foreignPivotKey, $this->parent->{$this->parentKey});
return $query->where($this->getQualifiedForeignPivotKeyName(), $this->parent->{$this->parentKey});
}

/**
Expand Down

0 comments on commit df0f50a

Please sign in to comment.