public function GetAidaMapamond($operator) { $AidaTari = Soap::AidaSoap($operator, 'GlobeCountries', ['AIDA_GlobeCountriesRQ' => ['Filters' => '']])->Countries->Country; $AidaOrase = Soap::AidaSoap($operator, 'GlobeCities', ['AIDA_GlobeCitiesRQ' => ['Filters' => '']])->Cities->City; $AidaRegiuni = Soap::AidaSoap($operator, 'GlobeRegions', ['AIDA_GlobeRegionsRQ' => ['Filters' => '']])->Regions->Region; // insert tari foreach ($AidaTari as $tara) { $arrayTari = ['AidaID' => $tara->ID, 'Name' => $tara->Name, 'Iso' => @$tara->ISO2]; Tari::UpdateOrCreate(['AidaID' => $tara->ID], $arrayTari); } // // insert orase foreach ($AidaOrase as $oras) { $arrayOrase = ['AidaID' => $oras->ID, 'Name' => $oras->Name, 'Country' => $oras->CountryID, 'Region' => @$oras->RegionID]; Orase::UpdateOrCreate(['AidaID' => $oras->ID, 'Updatabil' => 1], $arrayOrase); } // insert regiuni foreach ($AidaRegiuni as $regiune) { $arrayRegiuni = ['AidaID' => $regiune->ID, 'Name' => $regiune->Name, 'Country' => $regiune->CountryID]; Regiuni::UpdateOrCreate(['AidaID' => $oras->ID], $arrayRegiuni); } echo 'Actualizare finalizata cu success. Puteti inchide fereastra.'; }