public function GetAidaFacilities($operator) { $facilitati = Soap::AidaSoap($operator, 'CodesList', ['AIDA_CodesListRQ' => ['List' => ['Type' => 'AccFacilities']]])->List->ListItem; //dd($facilitati); $facilitati_updatabile = HoteluriFacilitati::where('Updatabil', 1)->get(); foreach ($facilitati as $facilitate) { if ($facilitati_updatabile != Null) { foreach ($facilitati_updatabile as $facilitate_updatabila) { $array = ['Name' => $facilitate->Name, 'Updatabil' => 0]; HoteluriFacilitati::where('Code', $facilitate_updatabila->Code)->update($array); } } $array = ['Code' => $facilitate->ID, 'Name' => $facilitate->Name, 'Updatabil' => 0]; $facilitatinoi = HoteluriFacilitati::firstOrNew(['Code' => $facilitate->ID])->create($array); } }
function getFacilitati($code) { return HoteluriFacilitati::where('Code', $code)->first(); }