We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 924837f commit 5ba231aCopy full SHA for 5ba231a
src/Jenssegers/Mongodb/Relations/HasMany.php
@@ -5,6 +5,16 @@
5
6
class HasMany extends EloquentHasMany
7
{
8
+ /**
9
+ * Get the plain foreign key.
10
+ *
11
+ * @return string
12
+ */
13
+ public function getForeignKeyName()
14
+ {
15
+ return $this->foreignKey;
16
+ }
17
+
18
/**
19
* Get the key for comparing against the parent key in "has" query.
20
*
tests/models/Client.php
@@ -19,6 +19,6 @@ public function photo()
public function addresses()
21
22
- return $this->hasMany('Address', 'data.address_id', 'data.client_id');
+ return $this->hasMany('Address', 'data.client_id', 'data.client_id');
23
}
24
0 commit comments