I'm having trouble finding the appropriate documentation on this.
I'm have a User
model, each User
can have a many to many relationship with a Site
. I am trying to find out how to get the relationships between User
s.
For example, one User
might be the Site
owner, and the other could be the Client
. If I have the owner object, how can I retrieve an array of Client
s, associated with all, or individual Site
s.
I've tried using
public function clients() {
return $this->hasManyThrough('User', 'Site');
}
However this still returns the current user which I'm unable to filter out.
I'm not sure if I have my models wrong, e.g. needing to have an Owner and a Client model, which both extend a generic User.
Any help would be appreciated.
Thanks.