Question:
in laravel 9 I implement many to many relationship.I have three table,
shop
, product
and product_shop
table.each shop can have
number
of every single product.
and each product can exist in multiple shops.the question is how can I insert/get the
number
of product inside the product_shop
table?what relationship syntax I have to use?
product_shop table :
Answer:
You can usepivot
. For example,If you have better answer, please add a comment about this, thank you!