1 year ago

Multirelations with 3 tables

Posted 1 year ago by Lipiniak


I have 3 tables - users, games and platforms. I wrote relation many-to-many for games and platforms via pivot table games_platforms, and it works just fine. But i have no idea how to create relations with those 3 tables with pivot table like user_id, game_id, platform_id.

I need to show user games and its platforms but user can have only some platforms for the game. So user have game on specific platform. Not game on all platforms.

Im thinking of using hasManyThrough but I dont realy understand how it works.

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