Good day, I'm new to laravel and have been attempting to figure out how on earth to do a multi-way relationship. I could be doing this completely wrong, so do bear with me.
So currently my db structure looks a little like this:
- Users
-id
-username
-Trades
-id
-user_id
-Trade_Items
-id
-trade_id
-item_id
-Item_db
-id
-image etc
Now, what I am trying to achieve is to be able to access all of the information to that makes up a User's 'trade', i.e I get all the user's trades, find out the trade items and return the information from the item_db.
Each user can have many trades, each trade can have many items and those items from Trade_Items relate to one section of the Item_db.
So, what I currently have is an absolute mess, I can post it but I'm not sure it will help very much. If someone could at least point me in the right direction, I would be extremely grateful!
to solve this. draw an ER diagram. you will get there in no time.
astroanu said:
to solve this. draw an ER diagram. you will get there in no time.
Well, I don't believe it - this actually helped me solve the problem, thank you.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community