ferdirn/laravel-id-countries
Laravel package to create and seed a countries table with global country data: name, ISO code, capital, currency, and calling code. Includes artisan commands to generate migrations and a seeder for quick setup in your app.
countries table with standardized country metadata (ISO codes, names, capitals, currencies, calling codes). This fits well in applications requiring reference data (e.g., user profiles, shipping addresses, or compliance forms) without needing external APIs.composer require and service provider registration. No complex dependencies beyond Laravel core.countries) avoids customization unless explicitly needed.dev-master branch (no stable release), risking breaking changes or lack of maintenance.countries table) conflict with existing DB structures?utf8mb4_unicode_ci).composer require ferdirn/laravel-id-countries:dev-master
Update config/app.php with the provider/alias.php artisan vendor:publish --provider="Ferdirn\Countries\CountriesServiceProvider"
(Only if customizing table name or fields.)countries table). Run:
php artisan migrate
countries table exists, drop it first or rename the existing table.php artisan db:seed --class=CountriesTableSeeder (if available).composer.json constraints).Countries::where('iso_code', 'US')->first()).Czechoslovakia).composer update may break if the package evolves.countries table for business logic (e.g., tax calculations).countries table schema/data for rollback.SELECT * FROM countries WHERE iso_code = ?).Countries::all()) in AppServiceProvider:
Countries::all()->remember(24 * 60); // Cache for 1 day
countries tables.countries table could slow down applications.// Get country by ISO code
$country = Countries::where('iso_code', 'GB')->first();
// Get all countries with currency
$countries = Countries::pluck('name', 'currency');
How can I help you explore Laravel packages today?