1. Go to this page and download the library: Download diegocopat/laravel-geodata library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use DiegoCopat\LaravelGeodata\Facades\GeoData;
// Countries
GeoData::countries(); // active countries
GeoData::countries(es
GeoData::regions();
GeoData::provinces();
GeoData::provincesByRegion('04'); // by region code
// Cities
GeoData::cities(); // all active cities
GeoData::citiesByProvince('TN'); // by province code
GeoData::searchCities('Trento'); // search by name
GeoData::searchCities('Rover', 'TN'); // search within province
// Lookups
GeoData::findByBelfiore('L378'); // city: Trento
GeoData::findByBelfiore('Z129'); // country: Romania
GeoData::findByCap('38122'); // cities by postal code
// Utilities
GeoData::isItaly('IT'); // true