public function getCountryStates($countryCode) { if ($states = \CountryState::getStates(strtoupper($countryCode))) { $return = ['states' => $states]; } else { $return = ['states' => null]; } return response()->json($return); }
public function testGetStateName() { $countryState = new CountryState(); $stateName = $countryState->getStateName('HI', 'US'); $this->assertEquals("Hawaii", $stateName); }