ahmard / geodata
A simple class that provides access to country & state list.
0.0.3
2022-06-17 21:28 UTC
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2024-12-18 03:08:56 UTC
README
A simple class that provides access to country & state list.
Installation
composer require ahmard/geodata
Usage
Fetch country list
<?php use Ahmard\GeoData\Country; require __DIR__ . '/vendor/autoload.php'; $countries = Country::all(); var_dump($countries);
Get country by phone code
<?php use Ahmard\GeoData\Country; require __DIR__ . '/vendor/autoload.php'; $countryInfo = Country::getByPhoneCode(234); var_dump($countryInfo);
Get country states
<?php use Ahmard\GeoData\Country; require __DIR__ . '/vendor/autoload.php'; $states = Country::getStates(160); var_dump($states);