public function getCurrentAndOldClientSurvysCategoriesData(Collection $surveys_categories_data, ClientSurvey $client_survey): Collection 	{ 		$base_client_survey_categories_data = collect(); 		$all_client_surveys_categories = collect(); 		$old_surveys_categories_data = collect();  		$client_survey_categories_data = $surveys_categories_data->where('key', $client_survey->id)->first()['category_data'] ?? [];  		$client_survey_categories_data = new Collection($client_survey_categories_data); 		$base_client_survey_categories_data = $client_survey_categories_data->sortBy([['ordering', 'asc']]); 		$old_surveys_categories_data = $surveys_categories_data->where('key', '<>', $client_survey->id)->all();  		$base_client_survey_categories_data->each(function (array $base_category_data) use (&$old_surveys_categories_data, &$all_client_surveys_categories) { 			$all_client_surveys_categories->push($base_category_data); 			$old_client_survey_diff_categories = collect($old_surveys_categories_data)->pluck('category_data')->flatten(1)->where('ordering', $base_category_data['ordering'])->where('code', '<>', $base_category_data['code']);  			if ($old_client_survey_diff_categories->count()) { 				$old_client_survey_diff_categories->each(function (array $category_data) use (&$all_client_surveys_categories) { 					$category_count = $all_client_surveys_categories->where('code', $category_data['code'])->count();  					if ($category_count == 0) { 						$all_client_surveys_categories->push($category_data); 					} 				}); 			} 		});  		return $all_client_surveys_categories; 	}