Skip to content

Commit 423a706

Browse files
committed
Update MorphTo.php
1 parent 0f00ab7 commit 423a706

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Relations/MorphTo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public function addConstraints()
1717
// or has many relationships, we need to actually query on the primary key
1818
// of the related models matching on the foreign key that's on a parent.
1919
$this->query->where(
20-
$this->ownerKey ?: $this->query->getModel()->getKeyName(),
20+
$this->ownerKey,
2121
'=',
22-
$this->parent->{$this->foreignKey},
22+
$this->getForeignKeyFrom($this->parent),
2323
);
2424
}
2525
}

0 commit comments

Comments
 (0)