i have same problem , please help , here is following structure
products
id
name
price
sku
attributes
id
name
attributes_values
id
attribute_id
value
product_attributes
id
product_id
attribute_id
value_id
class Product extends Model
{
}
class Attributes extends Model
{
}
class AttributesValue extends Model
{
}
i need following result in Lumen Laravel Framework
{
id: 1
name: Product A
price: 20.00
sku:000111
attributes:[
{
name: Attribute A
value: Attirbute Value A
},
{
name: Attribute B
value: Attirbute Value B
}
]
}