We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f00ab7 commit 423a706Copy full SHA for 423a706
src/Relations/MorphTo.php
@@ -17,9 +17,9 @@ public function addConstraints()
17
// or has many relationships, we need to actually query on the primary key
18
// of the related models matching on the foreign key that's on a parent.
19
$this->query->where(
20
- $this->ownerKey ?: $this->query->getModel()->getKeyName(),
+ $this->ownerKey,
21
'=',
22
- $this->parent->{$this->foreignKey},
+ $this->getForeignKeyFrom($this->parent),
23
);
24
}
25
0 commit comments