public function products(FilterProducts $request): JsonResource 	{ 		$lang = app()->getLocale();  		$products = Product::available() 			->notDiscontinued() 			->when($request->has('featured'), function ($query) { 				$query->featured(); 			}) 			->when($request->has('popular'), function ($query) { 				$query->popular(); 			}) 			->when($request->has('stocked'), function ($query) { 				$query->inStock(); 			}) 			->search($request->search, $lang) 			->notAccessory() 			->filterCategory($request->category_slug, $lang) 			->filterColor($request->color) 			->filterManufacturer($request->manufacturer) 			->dynamicFilters($request->filters) 			->priceRange($request->price_min, $request->price_max) 			->includes() 			->get() 			->groupBy('category.name');  		$min_price = $products->flatten()->min('price_with_pdv') ?? 0; 		$max_price = $products->flatten()->max('price_with_pdv') ?? $request->price_max ?? 50; 		$min_price = $min_price == $max_price ? 0 : $min_price; 		$manufacturers = Manufacturer::available()->includes()->get(); 		$possible_colors = app(GeneralSettings::class)->colors;  		return new CategoryProductsWithColorResource($products, $possible_colors, $min_price, $max_price, $manufacturers); 	}