I have searched through whole internet and couldn't find any reliable solution for this problem
so i have tables as follow:
- products
- id
- name
- description
- subcategories
- id(pk)
- subcategory_name
- is_active
- product_details
- id (pk)
- product_id(fk)
- sku
- price
- subcategory_id(fk)
- is_active
- product_attributes
- id (pk)
- product_detail_id (fk)
- size_id (fk)
- color_id (fk)
- material_id(fk)
- brand_id (fk)
- rating
- sub_images
- id(pk)
- product_attribute_id(fk)
- sub_image
Now want result of these as multidimensional array like this
i'm just novice at eloquent models so only option left is writing queries with query builder and converting them into multidimensional array. But i dont know how! Please help me