File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/Eloquent/CustomRelations Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -197,9 +197,11 @@ public function one()
197197
198198 return Relation::macroNoConstraints (function () use ($ relationName ): HasOne {
199199 $ this ->parent ->nowEagerLoadingRelationNameWithNoConstraints = $ relationName ;
200+ $ builder = $ this ->getQuery ()->clone ();
201+ $ builder ->setQuery ($ builder ->getQuery ()->clone ());
200202
201203 $ hasOne = new HasOne (
202- $ this -> getQuery () ,
204+ $ builder ,
203205 $ this ->parent ,
204206 $ this ->foreignKey ,
205207 $ this ->localKey
@@ -321,9 +323,11 @@ public function one()
321323
322324 return Relation::macroNoConstraints (function () use ($ relationName ): MorphOne {
323325 $ this ->getParent ()->nowEagerLoadingRelationNameWithNoConstraints = $ relationName ;
326+ $ builder = $ this ->getQuery ()->clone ();
327+ $ builder ->setQuery ($ builder ->getQuery ()->clone ());
324328
325329 $ morphOne = new MorphOne (
326- $ this -> getQuery () ,
330+ $ builder ,
327331 $ this ->getParent (),
328332 $ this ->morphType ,
329333 $ this ->foreignKey ,
You can’t perform that action at this time.
0 commit comments