Skip to content

Commit

Permalink
Use model instance instead of parent
Browse files Browse the repository at this point in the history
Co-Authored-By: Jonas Staudenmeir <[email protected]>
  • Loading branch information
Mushr0000m and staudenmeir authored Jul 10, 2019
1 parent 2063614 commit df2f36c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Relations/MorphTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit df2f36c

Please sign in to comment.