Check out hasManyThrough
https://laravel.com/docs/5.3/eloquent-relationships#has-many-through
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi Guys,
i am stuck with a normally simple relationship (with normal queries), but i am stuck with eloquent
Let's say i have 3 tables: account user teams
with 3 pivot tables account_user account_team user_team
So basically every user can have multiple accounts and multiple teams within an account.
And there is my problem, how do i get f.e. the users teams based on one account?
Hope somebody can help me?
Greets Marcus
Please or to participate in this conversation.