private function updateSite($markerSite) { $existingSite = MarkerSite::find($markerSite->id); $existingDistribution = Distribution::find($existingSite->distribution); $existingSite->update($markerSite->toArray()); Log::debug("Updated " . $markerSite->id . " from " . $_SERVER['REMOTE_ADDR']); //Remove NonStandard Distribution as no marker site would be refering it if ($existingDistribution && $existingDistribution->isNonStandard()) { Distribution::destroy($existingDistribution->id); } return $existingSite; }