return Product::where('categories.id', $categoryId)->where('products.hidden', 0)
->leftJoin('products_in_categories', 'products_in_categories.prod_id', '=', 'products.id')
->leftJoin('categories', 'products_in_categories.cat_id', '=', 'categories.id')
->leftJoin('furnitures', 'products.furniture', '=', 'furnitures.id')
->paginate(10, array('products.*', 'categories.slug as cat_slug', 'furnitures.slug as furn_slug'));
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community