File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/Jenssegers/Mongodb/Relations Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public function addConstraints()
11
11
// For belongs to relationships, which are essentially the inverse of has one
12
12
// or has many relationships, we need to actually query on the primary key
13
13
// of the related models matching on the foreign key that's on a parent.
14
- $ this ->query ->where ($ this ->otherKey , '= ' , $ this ->parent ->{$ this ->foreignKey });
14
+ $ this ->query ->where ($ this ->ownerKey , '= ' , $ this ->parent ->{$ this ->foreignKey });
15
15
}
16
16
}
17
17
@@ -25,7 +25,7 @@ public function addEagerConstraints(array $models)
25
25
// We'll grab the primary key name of the related models since it could be set to
26
26
// a non-standard name and not "id". We will then construct the constraint for
27
27
// our eagerly loading query so it returns the proper models from execution.
28
- $ key = $ this ->otherKey ;
28
+ $ key = $ this ->ownerKey ;
29
29
30
30
$ this ->query ->whereIn ($ key , $ this ->getEagerModelKeys ($ models ));
31
31
}
You can’t perform that action at this time.
0 commit comments