Download the PHP package laravel-enso/countries without Composer
On this page you can find all versions of the php package laravel-enso/countries. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravel-enso/countries
More information about laravel-enso/countries
Files in laravel-enso/countries
Informations about the package countries
Countries
Description
Countries provides the country reference dataset used across the Laravel Enso ecosystem.
The package ships the countries table, a JSON-backed seeder for the full country list, an Eloquent model with a few convenience behaviors, and an authenticated options endpoint meant for select inputs.
It is a foundational backend package for address management, currencies, webshop flows, and any feature that needs normalized country metadata such as ISO codes, currency details, calling codes, or flags.
Installation
This package comes pre-installed in Laravel Enso applications that require country metadata.
For standalone installation in an Enso-based application:
The package automatically:
- loads its API routes
- loads its migrations
- publishes its seeders when requested
Run the migrations after installation:
If you want the package seeder in your application's database seeders directory, publish it with:
Then seed the table:
Features
- Creates the
countriestable with ISO, currency, region, and calling metadata. - Ships a JSON-backed seeder for the full country dataset.
- Provides an Eloquent
Countrymodel with rememberable lookup keys. - Registers
nameandfull_nameas translatable model attributes for localisation scans. - Exposes an authenticated
optionsendpoint for select inputs. - Returns only active countries through the options endpoint.
- Includes a region label helper that adapts for Romania and the United States.
Usage
Fetch active country options through the API:
Query the model directly:
The options endpoint serializes countries in a frontend-friendly shape:
::: warning Note The package exposes only active countries through its options endpoint.
If you seed or modify the dataset manually, remember that inactive rows will not be returned by core.countries.options.
:::
API
Routes
All package routes are registered under:
- prefix:
api/core/countries - name prefix:
core.countries. - middleware:
api,auth,core
Endpoints:
GET /api/core/countries/options
Controller
LaravelEnso\Countries\Http\Controllers\Options
Behavior:
- builds select-style options through
LaravelEnso\Select\Traits\OptionsBuilder - filters by active countries only
- allows querying by
nameandiso_3166_3
Resource
LaravelEnso\Countries\Http\Resources\Country
Serialized attributes:
idnamecurrencyCode
Model
LaravelEnso\Countries\Models\Country
Useful traits:
ActiveStateAvoidsDeletionConflictsHasFactoryRememberable
Translatable attributes:
namefull_name
Rememberable keys:
idiso_3166_2name
Useful method:
regionLabel(): string
Seeder
LaravelEnso\Countries\Database\Seeders\CountrySeeder
Reads the dataset from:
vendor/laravel-enso/countries/database/countries.json
Depends On
Required Enso packages:
laravel-enso/core↗laravel-enso/dynamic-methods↗laravel-enso/enums↗laravel-enso/helpers↗laravel-enso/localisation↗laravel-enso/migrator↗laravel-enso/rememberable↗laravel-enso/select↗
Framework dependency:
Contributions
are welcome. Pull requests are great, but issues are good too.
Thank you to all the people who already contributed to Enso!
All versions of countries with dependencies
laravel-enso/dynamic-methods Version ^4.0
laravel-enso/enums Version ^3.0
laravel-enso/helpers Version ^4.0
laravel-enso/localisation Version ^5.7
laravel-enso/migrator Version ^2.1
laravel-enso/rememberable Version ^4.0
laravel-enso/select Version ^5.0
laravel/framework Version ^10.0|^11.0|^12.0|^13.0