public function update(UpdateSpecsCategory $request, SpecsCategory $id): RedirectResponse 	{ 		$langs = getCurrentLanguages();  		$id->update([ 			'name' => $request->name, 			'market_id' => getCurrentMarket()->id, 		]);  		// DELETE OLD SPECS 		$deletedSpecs = $id->specs() 			->whereNotIn('id', $request->input('specs_id') ?? []) 			->pluck('id'); 		$id->specs()->whereIn('id', $deletedSpecs)->delete();  		// UPDATE SPECS 		foreach ($request->input('specs_id') ?? [] as $i => $value) { 			$spec = $id->specs()->findOrNew($value); 			$specsRow = [];  			foreach ($langs as $lang) { 				$specsRow[$lang] = $request->specs[$lang][$i]; 			} 			$spec->name = $specsRow; 			$spec->save(); 		}  		// CREATE NEW SPECS 		$numberOfNewElements = count($request->new_specs[$langs[0]] ?? []);  		for ($i = 0; $i < $numberOfNewElements; $i++) { 			$specsRow = [];  			foreach ($langs as $lang) { 				$specsRow[$lang] = $request->new_specs[$lang][$i]; 			} 			$id->specs()->create([ 				'name' => $specsRow, 			]); 		}  		return $this->redirectFromSave('specs-categories.list'); 	}