Oct 12, 2020
0
Level 3
Product Attributes and Attrubutes Value Table Complications
I have 4 tables in my database.
- Product
- Product Attributes
- Product Attributes Value
- Product Combinations
I have a question where table 2 and 3 are related.
for example I have 3 colors and 4 size for an product that makes a combination of 12 variety.
should I have 12 records in product attribute value table i.e. 3 record of color and 4 record of size or 1 record for each color and size respectively where all the variety are store as JSON or separated via comma ",".
There might also be a situation where we have 3 colors but each color don't have 4 size some color can only have 1 or 2 size also. How should I handle this via Eloquent Methods.
Please or to participate in this conversation.