public function storeImport(Request $request): RedirectResponse 	{ 		$csvFile = fopen($request->file('file')->getPathname(), 'r'); 		$skipHeaderRow = $request->boolean('header_row'); 		$csvEntries = [];  		while ($data = fgetcsv($csvFile)) { 			if ($skipHeaderRow) { 				$skipHeaderRow = false;  				continue; 			}  			$title = $data[0] ?? ''; 			$address = $data[1] ?? ''; 			$zip_code = $data[2] ?? ''; // za geocoding 			$city = $data[3] ?? ''; // za geocoding 			$phone = $data[4] ?? ''; 			$email = $data[5] ?? ''; 			$oib = $data[6] ?? ''; // za parent pharmacy  			$validator = Validator::make([ 				'title' => $title, 				'email' => $email, 				'phone' => $phone, 				'address' => $address, 			], [ 				'title' => ['required', 'string', 'max:100'], 				'address' => ['nullable', 'string', 'max:50'], 				'phone' => ['nullable', 'string', 'max:50'], 				'email' => ['nullable', 'string', 'max:50', 'email'], 			]);  			if ($validator->fails()) { 				continue; 			}  			$csvEntries[] = [ 				'title' => $title, 				'physical' => ShopType::PHYSICAL, 				'address' => $address, 				'zip_code' => $zip_code, 				'city' => $city, 				'phone' => $phone, 				'email' => $email, 				'oib' => $oib, 			]; 		} 		// explanation : entries are grouped by oib, for each oib there 		// has to be a parent pharmacy, so we create it first, then we 		// create all the other pharmacies and set the parent pharmacy 		// id to the parent pharmacy id 		// the parent pharmacy is the first entry in the group 		// and cannot have a '-' in the title 		$csvEntries = collect($csvEntries)->groupBy('oib');  		foreach ($csvEntries as $value) { 			$lat = null; 			$lng = null; 			$this->parentId = null;  			foreach ($value as $item) { 				// sleep for 0.1 seconds to avoid google api limit 				$titles = explode('-', $item['title'], 2);  				// if($item['address'] != '' && $item['city'] != ''){ 				// 	$mapsHandler = new GoogleMapGeocoder(); 				// 	$location = $mapsHandler->getLocationByAddress($item['address'] . $item['city']); 				// 	$lat =$location["results"][0]["geometry"]["location"]["lat"] ?? null; 				// 	$lng =$location["results"][0]["geometry"]["location"]["lng"] ?? null; 				// } 				if (!(isset($titles[1]))) { 					$id = Shop::create([ 						'title' => $item['title'], 						'type' => ShopType::PHYSICAL, 						'address' => $item['address'], 						'phone' => $item['phone'], 						'email' => $item['email'], 						'latitude' => $lat, 						'longitude' => $lng, 					]); 					$this->parentId = $id->id;  					continue; 				} 				Shop::create([ 					'title' => $titles[1], 					'type' => ShopType::PHYSICAL, 					'address' => $item['address'], 					'phone' => $item['phone'], 					'email' => $item['email'], 					'latitude' => $lat, 					'longitude' => $lng, 					'parent_shop_id' => $this->parentId, 				]); 			} 		} 		fclose($csvFile);  		return $this->redirectFromSave('shops.list'); 	}