From df2f36c3e1b733eb006cd27b240d68e6fa8bcb3b Mon Sep 17 00:00:00 2001 From: Aimery Marsily Date: Wed, 10 Jul 2019 16:32:50 +0200 Subject: [PATCH] Use model instance instead of parent Co-Authored-By: Jonas Staudenmeir --- src/Illuminate/Database/Eloquent/Relations/MorphTo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php b/src/Illuminate/Database/Eloquent/Relations/MorphTo.php index 08b80f24a1a3..521730b3c910 100644 --- a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php +++ b/src/Illuminate/Database/Eloquent/Relations/MorphTo.php @@ -123,7 +123,7 @@ protected function getResultsByType($type) (array) ($this->morphableEagerLoads[get_class($instance)] ?? []) )); - $whereIn = $this->whereInMethod($this->parent, $ownerKey); + $whereIn = $this->whereInMethod($instance, $ownerKey); return $query->{$whereIn}( $instance->getTable().'.'.$ownerKey, $this->gatherKeysByType($type)