PHP code example of lartie / airports
1. Go to this page and download the library: Download lartie/airports 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/ */
lartie / airports example snippets
'providers' => [
...
LArtie\Airports\AirportsServiceProvider::class,
]
$country = Country::where('name_en', 'Russia')->first();
$city = $country->cities()->first();
$city->name_en;
$city->name_ru;
$country = $city->country()->first();
$country->name_en;
$country->name_ru;
$country->iso_code;
$airport = $city->airports()->first();
$airport->gmt_offset;
$airport->iata_code;
$airport->icao_code;
$city = $airport->city()->first();
bash
php artisan vendor:publish
php artisan migrate
php artisan airports:install