Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lartie/airports

List of airports
https://github.com/lartie/airports

airport airports composer dump iana iana-database iana-tzdb iata iata-codes laravel laravel-package php sql

Last synced: 12 days ago
JSON representation

List of airports

Awesome Lists containing this project

README

        

# Airports for Laravel 5

[![Latest Stable Version](https://poser.pugx.org/lartie/airports/v/stable)](https://packagist.org/packages/lartie/airports)
[![Total Downloads](https://poser.pugx.org/lartie/airports/downloads)](https://packagist.org/packages/lartie/airports)
[![Latest Unstable Version](https://poser.pugx.org/lartie/airports/v/unstable)](https://packagist.org/packages/lartie/airports)
[![License](https://poser.pugx.org/lartie/airports/license)](https://packagist.org/packages/lartie/airports)
[![composer.lock](https://poser.pugx.org/lartie/airports/composerlock)](https://packagist.org/packages/lartie/airports)

## Install

```bash
composer require lartie/airports
```

```php
'providers' => [
...
LArtie\Airports\AirportsServiceProvider::class,
]
```

```bash
php artisan vendor:publish

php artisan migrate

php artisan airports:install
```

## Usage

```php
$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