public function update(Product $id, UpdateProduct $request, PdvCalculationService $PDVCalculationService): RedirectResponse 	{ 		$langs = getCurrentLanguages(); 		$mainLang = getMainActiveLanguage();  		// PRODUCT 		$id->update([ 			'name' => $request->name, 			'matching_name' => trim($request->matching_name), 			'sku' => $request->sku, 			'market_id' => getCurrentMarket()->id, 			'manufacturer_id' => $request->manufacturer_id, 			'video_url' => $request->video_url, 			'price_without_pdv' => $request->price_without_pdv, 			'weight' => $request->weight, 			'price_with_pdv' => $PDVCalculationService->calculatePriceWithPdv($request->price_without_pdv, $request->pdv_rate), 			'color' => $request->color, 			'description' => $request->description, 			'category_id' => $request->category_id ?? null, 			'accessory' => $request->boolean('accessory'), 			'popular' => $request->boolean('popular'), 			'featured' => $request->boolean('featured'), 			'active' => $request->boolean('active'), 			'stocked' => $request->boolean('stocked'), 			'discontinued' => $request->boolean('discontinued'), 		]);  		$id->storage()->handle($request->media);  		// DETAILS 		$id->details()->update([ 			'benefits' => $request->benefits, 			'features' => $request->features, 			'support' => $request->support, 			'use_care' => $request->use_care, 		]);  		$id->details?->storage()->handle();  		// SPECS 		$product_specs = ProductSpecsItemValue::where('product_id', $id->id)->get();  		$specs = $request->specs ?? [];  		$id->specsCategories()->sync($request->specs_categories);  		foreach ($specs[$mainLang] ?? [] as $key => $value) { 			$specsRow = []; 			$spec = $product_specs->firstWhere('specs_item_id', $key);  			foreach ($langs as $lang) { 				$specsRow[$lang] = $specs[$lang][$key] ?? ''; 			} 			$data = [ 				'product_id' => $id->id, 				'specs_item_id' => $key, 				'name' => $specsRow, 			];  			if ($spec) { 				$spec->update($data); 			} else { 				$id->values()->create($data); 			} 		}  		// FAQS 		$id->faqs()->delete();  		$data = [];  		for ($i = 0; $i < count($request->order_number ?? []); $i++) { 			$questions_row = []; 			$answers_row = [];  			foreach ($langs as $lang) { 				$questions_row[$lang] = $request->question[$lang][$i]; 				$answers_row[$lang] = $request->answer[$lang][$i]; 			} 			$data[] = new ProductFaq([ 				'question' => $questions_row, 				'answer' => $answers_row, 				'order_number' => $request->order_number[$i] ?? 0, 			]); 		}  		$id->faqs()->saveMany($data);  		// SHOPS 		$id->shops()->sync($request->shops);  		// INCLUDED AND AVAILABLE ACCESSORIES 		$id->accessories()->detach(); 		$id->accessories()->attach($request->included_accessories ?? [], ['included' => true]); 		$id->accessories()->attach($request->available_accessories ?? [], ['included' => false]);  		// FILTERS 		$id->productFilters->each->delete();  		foreach ($request->filters ?? [] as $filter_id => $value) { 			$id->productFilters()->create([ 				'filter_id' => $filter_id, 				'value' => json_decode($value) ?? $value ?? null, 			]); 		}  		return $this->redirectFromSave('products.list'); 	}