Closed shanerbaner82 closed 4 years ago
Use this relationship:
class TeamLeader extends Model
{
use \Staudenmeir\EloquentHasManyDeep\HasRelationships;
public function clients()
{
return $this->hasManyDeep(Client::class, [Agent::class, 'agent_client']);
}
}
Worked like a charm! I figured I just had something out of place.
Thanks! And great job on this package!
I think this package will work for my needs, but I am having an issue finding the right syntax.
We have Team Leaders that have many Agents working for them, Agents have many Clients, but Clients can belong to many Agents, not just one.
So how would I: Team Leader → has many → Agents → many to many → Clients with hasManyDeep?