private function createCountries($countries) { foreach ($countries as $data) { $country = new Country(); $country->id = $data['id']; $country->code = $data['code']; $country->save(); } }