ijeffro/laravel-airports
Laravel Airports provides IATA codes, ISO 3166-3 and country codes for airports, plus a service provider, facade, migration and seeder to populate an airports table. Install via Composer, publish config, migrate and seed for searchable airport data.
find, exists, inCountry, search, options) works with zero database setup. That means airport autocomplete, country-filtered dropdowns, and IATA validation can ship in a thin slice rather than waiting on a schema, migration, and seeding workstream.AirportCode rule validates codes from the in-memory dataset, so you get "no invalid IATA codes in forms/imports" without requiring the published airports table. This is a product-quality win at near-zero operational cost, and it removes a common source of silent validation failures (exists:airports,iata when the table was never seeded).airports table. PM should explicitly decide which is authoritative:
ijeffro\Airports → FLAIRUK\Airports, PHP 8.2+, Laravel 12/13), not a patch. For teams on Laravel 5–11, this is a migration project with call-site changes (arrays → readonly objects, getByIata → find), so it belongs in roadmap planning, not a routine dependency bump.Consider it when:
FLAIRUK\Airports release.ijeffro/* and Laravel 5 instructions while v1.0.0 documents flairuk/laravel-airports and auto-discovery). Verify the actual package name and namespace in composer show before committing.Look elsewhere or proceed with caution when:
dev-master is effectively unsupported; upgrading is a hard-fork migration, not a composer update.For executives: This is a small, MIT-licensed utility that removes a multi-week data and validation chore from the travel/booking roadmap. It lets us ship airport selection and IATA validation in the first release instead of building and maintaining our own airport dataset. The trade-off is maturity: it has very low public adoption, so we should use it narrowly, pin the version, and keep it behind an internal interface so it can be replaced or forked without product disruption. It is low-cost, low-lock-in, and not a platform bet.
For engineering: The v1.0.0 line targets Laravel 12/13 and PHP 8.2+, auto-discovers its provider, and ships an opcache-friendly PHP array backing a readonly Airport value-object API (find, findOrFail, exists, inCountry, search, options), an AirportCode validation rule, and an optional publishable migration/model/seeder with airports:install and airports:seed. It is easy to unit test with no database. Key implementation cautions: the README's top-level install block is stale (ijeffro/*, Laravel 5) versus the v1.0.0 FLAIRUK\Airports namespace; audit for array-offset access and getByIata-era idioms; normalize IATA codes with strtoupper(trim()) at the boundary; and decide explicitly whether the in-memory array or the DB table is authoritative.
Recommendation: Adopt for a narrowly scoped feature — validation, dropdowns, autocomplete — behind a single internal airport service. Pin a specific release, verify the installed package/namespace, document the data-authority decision, and keep a fork/data-refresh contingency. Do not make it a dependency of core pricing, inventory, or reporting logic until adoption and maintenance signals improve.
How can I help you explore Laravel packages today?