Download the PHP package ijeffro/laravel-airports without Composer
On this page you can find all versions of the php package ijeffro/laravel-airports. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download ijeffro/laravel-airports
More information about ijeffro/laravel-airports
Files in ijeffro/laravel-airports
Download ijeffro/laravel-airports
More information about ijeffro/laravel-airports
Files in ijeffro/laravel-airports
Vendor ijeffro
Package laravel-airports
Short Description IATA airport codes for Laravel: an in-memory lookup API, validation rule and optional database table.
License MIT
Homepage https://github.com/FLAIRUK/laravel-airports
Package laravel-airports
Short Description IATA airport codes for Laravel: an in-memory lookup API, validation rule and optional database table.
License MIT
Homepage https://github.com/FLAIRUK/laravel-airports
Please rate this library. Is it a good library?
Informations about the package laravel-airports
**Laravel Airports** โ Over 10,000 IATA airport codes (`LHR`, `JFK`, `DXB`, โฆ) for Laravel 12 and 13.
- **No database required.** Look airports up through a facade backed by an in-memory dataset.
- **Typed results.** Every lookup returns readonly `Airport` objects in Laravel collections keyed by code.
- **Validation rule.** `new AirportCode` accepts known codes only.
- **Optional table.** Publish a migration and seed an `airports` table when other tables need to reference airports.
๐ฆ Installation ยท ๐ Usage ยท ๐พ Database table ยท ๐ Upgrading
## ๐ฆ Installation Requires PHP 8.2 or later with Laravel 12, or PHP 8.3 or later with Laravel 13. Laravel discovers the service provider and the `Airports` facade automatically.
## ๐ Usage ### Select options ### Validation `AirportCode` ignores case but `different` does not, so `LHR` and `lhr` would pass as different airports. Uppercase both fields first (for example in a form request's `prepareForValidation()`) when that matters. ### Dependency injection The facade resolves a singleton `FLAIRUK\Airports\Airports`, which you can type-hint instead.
## ๐พ Database table (optional) You can also call the seeder from your own `DatabaseSeeder`: Query the table through the bundled Eloquent model: The table name and connection come from `AIRPORTS_TABLE` and `AIRPORTS_DB_CONNECTION`, or from the published config.
## ๐ Upgrading from dev-master Version 1.0 is a rewrite. Breaking changes: | dev-master | 1.0 | | --- | --- | | Package `ijeffro/laravel-airports` | `flairuk/laravel-airports` | | `ijeffro\Airports\โฆ` namespace | `FLAIRUK\Airports\โฆ` | | Facade `ijeffro\Airports\AirportsFacade` | `FLAIRUK\Airports\Facades\Airports` (auto-discovered) | | `Airports::getList($sort)` (array) | `Airports::all()->sortBy($property, SORT_NATURAL \| SORT_FLAG_CASE)` (Collection of `Airport`; properties are camelCase, e.g. `countryCode`) | | `Airports::getOne($id)` | `Airports::findById($id)` or `Airports::find($code)` | | `Airports::getListForSelect()` (keyed by id) | `Airports::options('id')` | | `php artisan airports:migration` | `php artisan airports:install` / `airports:seed` | | Config key `airports.table_name` | `airports.table` | Row `id`s and columns (`code`, `name`, `country_code`) are unchanged, so existing tables and foreign keys stay valid.
## ๐งช Testing
## ๐ License MIT. See [LICENSE](LICENSE).
All versions of laravel-airports with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.2
illuminate/console Version ^12.0|^13.0
illuminate/database Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
illuminate/validation Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/database Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
illuminate/validation Version ^12.0|^13.0
The package ijeffro/laravel-airports contains the following files
Loading the files please wait ...