/** * Retrieve all categories with their products * Products can have a category_id_sub : if it is not null, a category with sub_ids can be shown on screen * * @return mixed */ public function index() { $products = $this->productRepository->getProductsOrderedByCategory(); return response()->json($products, 200); }