Relationships

Published 2 months ago by meteguerlek

Hi, my tables:

users

  • id

orders

  • id
  • user_id

steps

  • id

items

  • id
  • step_id

user_step_items

  • id
  • user_id
  • order_id
  • step_id
  • item_id

I wanted the steps which user has. Maybe i need other table? Like:

order_step

  • order_id
  • step_id
jlrdw
jlrdw
2 months ago (251,920 XP)

Perhaps work some of the basic examples in the docs, maybe start with a one to many, and go from there.

Remember Jeffrey has many free videos.

Get to the point where you are trying the code, and ask a question once you have code to show that you tried.

Also many here have worked with relational DBMS for 20, even 30 or more years.

Perhaps take some time and study Relational Database theory.

For further info, Jeffrey has many free videos on the basics.

These are whole series:

https://laracasts.com/series/php-for-beginners

https://laracasts.com/series/laravel-from-scratch-2017

Both series are free.

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