Download the PHP package flairuk/laravel-cities without Composer
On this page you can find all versions of the php package flairuk/laravel-cities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download flairuk/laravel-cities
More information about flairuk/laravel-cities
Files in flairuk/laravel-cities
Download flairuk/laravel-cities
More information about flairuk/laravel-cities
Files in flairuk/laravel-cities
Vendor flairuk
Package laravel-cities
Short Description IATA city codes for Laravel: an in-memory lookup API, validation rule and optional database table.
License MIT
Homepage https://github.com/FLAIRUK/laravel-cities
Package laravel-cities
Short Description IATA city codes for Laravel: an in-memory lookup API, validation rule and optional database table.
License MIT
Homepage https://github.com/FLAIRUK/laravel-cities
Please rate this library. Is it a good library?
Informations about the package laravel-cities
**Laravel Cities** โ More than 9,000 IATA city codes (`LON`, `NYC`, `PAR`, โฆ) for Laravel 12 and 13. In IATA's scheme a city code groups the airports that serve a city, as `LON` does for Heathrow, Gatwick and Stansted. This package lists the city codes; it does not map them to airports.
- **No database required.** Look cities up through a facade backed by an in-memory dataset.
- **Typed results.** Every lookup returns readonly `City` objects in Laravel collections keyed by code.
- **Validation rule.** `new CityCode` accepts known codes only.
- **Optional table.** Publish a migration and seed a `cities` table when other tables need to reference cities.
๐ฆ 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 `Cities` facade automatically.
## ๐ Usage ### Select options ### Validation
## ๐พ 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 `CITIES_TABLE` and `CITIES_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-cities` | `flairuk/laravel-cities` | | `ijeffro\Cities\โฆ` namespace | `FLAIRUK\Cities\โฆ` | | Facade `ijeffro\Cities\CitiesFacade` | `FLAIRUK\Cities\Facades\Cities` (auto-discovered) | | `Cities::getList($sort)` (array) | `Cities::all()->sortBy($property, SORT_NATURAL \| SORT_FLAG_CASE)` (Collection of `City`; properties are camelCase, e.g. `countryCode`) | | `Cities::getOne($id)` | `Cities::findById($id)` or `Cities::find($code)` | | `Cities::getListForSelect()` (keyed by id) | `Cities::options('id')` | | `php artisan cities:migration` | `php artisan cities:install` / `cities:seed` | | Config key `cities.table_name` | `cities.table` | | Field / column `iso_3166_3` | **`code`**. It was always an IATA city code, not an ISO 3166 code | Row `id`s are unchanged. If you have an existing table, rename the column before re-seeding:
## ๐งช Testing
## ๐ License MIT. See [LICENSE](LICENSE).
All versions of laravel-cities 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 flairuk/laravel-cities contains the following files
Loading the files please wait ...