1. Go to this page and download the library: Download flairuk/laravel-world 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/ */
flairuk / laravel-world example snippets
use FLAIRUK\World\Facades\World;
World::country('GBR'); // Country, or null
World::countryOrFail('GB'); // throws ItemNotFoundException for an unknown code
World::citiesIn('GB'); // Collection of City: LON, MAN, EDI, …
World::airportsIn('GBR'); // Collection of Airport: LHR, LGW, MAN, …
World::airlinesIn(826); // Collection of Airline: BA, VS, …
$profile = World::profile('GB'); // CountryProfile, or null
$profile->country; // Country
$profile->cities; // Collection of City
$profile->airports; // Collection of Airport
$profile->airlines; // Collection of Airline
return $profile; // {"country": {...}, "cities": [...], "airports": [...], "airlines": [...]}