Commit 5ba231a1 authored by Jens Segers's avatar Jens Segers

Making progress on fixing relations

parent 924837f0
......@@ -5,6 +5,16 @@ use Illuminate\Database\Eloquent\Relations\HasMany as EloquentHasMany;
class HasMany extends EloquentHasMany
{
/**
* Get the plain foreign key.
*
* @return string
*/
public function getForeignKeyName()
{
return $this->foreignKey;
}
/**
* Get the key for comparing against the parent key in "has" query.
*
......
......@@ -19,6 +19,6 @@ class Client extends Eloquent
public function addresses()
{
return $this->hasMany('Address', 'data.address_id', 'data.client_id');
return $this->hasMany('Address', 'data.client_id', 'data.client_id');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment