I have a categories
table
CREATE TABLE categories (
name
clean_name
image
description
lft
rgt
)
I need to be able to query all products within a category, organized by sub-categories. In other words:
Products
-Electronics
--Portable
>>> Product 1
>>> Product 2
--TV
>>> Product 1
>>> Product 2
>>> Product 3
So I'd love to be able to loop over Electronics
and display the products within their distinctive categories...
So far, all I've been able to do is use a raw
query to return the categories, but all on one level, and no products.
Ideally, I'd love to use Eloquent
to manage all of this...