Closed jaxramus closed 2 years ago
Holy shit I think I got it:
public function managers()
{
return $this->hasManyDeepFromRelations($this->salespeople(), (new User)->setAlias('salesperson')->managers());
}
Dude you're a genius. This package is insane.
I have 2 models/tables:
a user can be a
manager
or asalesperson
i have 2 pivot tables:
in my lead model, here is my belongstomany for salespeople:
in my user model, here are my belongstomany for leads, managers, & salespeople:
i am trying to create a managers relationship in the lead model:
this gives me the following error:
i would like to get all the managers for a lead through the salespeople
how do i specify the correct keys and table aliases to use in the hasmanydeep method in this case?
i can't seem to find the docs to specify this given my use case.