Skip to content

Commit 8a0625d

Browse files
authored
use already determined related property (#55075)
we already pull the related model off of the `$query` in the constructor, so we can use it directly. introduced in #43724
1 parent d7b5366 commit 8a0625d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Database/Eloquent/Relations/Relation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ abstract public function getResults();
172172
public function getEager()
173173
{
174174
return $this->eagerKeysWereEmpty
175-
? $this->query->getModel()->newCollection()
175+
? $this->related->newCollection()
176176
: $this->get();
177177
}
178178

0 commit comments

Comments
 (0)