HasManyThrough with two pivot tables

Posted 3 years ago by wheredidgogogo

This one is starting to fry my brain...

I have five tables:


roles_users (pivot)


permissions_roles (pivot)


I can't for the life of me create a query that returns the permissions for a given user.

I can get hasmanythrough to work with just one pivot table and a one-to-one relationship for the second step. But I can't get it to work when there are 2 many-to-many relationships.

Any help would be greatly appreciated :)

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.