Skip to content

lartie/Airports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Airports for Laravel 5

Latest Stable Version Total Downloads Latest Unstable Version License composer.lock

Install

composer require lartie/airports
'providers' => [
  ...
  LArtie\Airports\AirportsServiceProvider::class,
]
php artisan vendor:publish

php artisan migrate

php artisan airports:install

Usage

$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();

License

MIT