ijeffro/laravel-airlines
Laravel Airlines provides IATA codes, ISO 3166-3 and country codes for airlines, with a service provider, facade, migration generator, and seeder to populate an airlines table in your Laravel app.
00) were returned as integers while alphanumeric ones came back as strings. If we expose airline codes through a public or partner API, consistent string typing is a contract-level requirement—this release makes that safe without us writing defensive normalization code.Adopt If:
codes() always returns strings, so strict comparisons, cache keys, and API payloads behave consistently.NOT NULL (these must be made nullable before seeding—plan this as a short migration task, not a blocker).Look Elsewhere If:
"This package lets us integrate IATA airline codes and country mappings into our platform with minimal dev effort—think of it as ‘plug-and-play’ data validation for flight searches or bookings. For example, if we’re launching a travel booking feature, this ensures users can’t submit invalid airline codes (e.g., ‘AAA’ instead of ‘AA’ for American Airlines), reducing support tickets and improving UX. The latest patch (v1.0.1) also hardens data consistency—airline codes now always come back in a single, predictable format—which matters if we ever expose this data to partners or via an API. It’s a low-risk, high-reward way to standardize critical travel data without building or maintaining our own database. The MIT license means no hidden costs, and the Laravel integration keeps it lightweight. Only caveat: if we already have airline data in strict database columns, there’s a small one-time schema adjustment to plan."
*"Laravel Airlines gives us a pre-built, Laravel-compatible way to access IATA airline codes (e.g., ‘DL’ for Delta) and ISO country codes (e.g., ‘US’ for the USA) tied to airlines. Key benefits:
codes() now returns every designator as a string—previously all-digit codes like 00 came back as integers, which would have broken strict comparisons, JSON payloads, and cache keys. If we’ve already integrated, this is a low-risk upgrade that removes a latent edge-case bug.airlines:install --migrate command; sorting uses a camelCase sortBy mapping documented in the README.
Tradeoffs: It’s static data—if we need live flight data, we’d still need a separate API (e.g., FlightAware). And upgrade note: if any existing country columns are NOT NULL, they must be made nullable before seeding—budget a short migration step. For codes, country mappings, and basic metadata, this is a 5-minute setup that saves weeks of work. Recommended for travel-related features where IATA compliance matters."*How can I help you explore Laravel packages today?