where('location_cities.id', $id)->first(); } return CityModel::all(); } public function getSubCities($country) { return $this->query()->where('parent_country_id', $country)->get(); } public function deleteCitiesByCountry($id) { $districts = new DistrictModel(); $city = $this->where('parent_country_id',$id); $city_id = $city->get(); foreach ($city_id as $item) { $districts->deleteDistrictByCity($item->id); } return $city->delete(); } }