lwwcas/laravel-countries
| Install | |
|---|---|
composer require lwwcas/laravel-countries |
|
| Latest Version: | 4.12.0.1 |
| PHP: | ^8.2|^8.3 |
| License: | MIT |
| Last Updated: | Mar 23, 2026 |
| Links: | GitHub · Packagist |
Laravel Countries drops a complete, already-translated dataset of the world's countries straight into your database — ISO codes, slugs, geographic coordinates, and detailed metadata — ready to query as a plain Eloquent model from the first Country:: call.
No external APIs, no JSON files to parse and cache yourself. Install the package, run one Artisan command, and countries behave like any other table in your app.
⭐ Enjoying this package?
If Laravel Countries saved you some time, consider leaving a star on the repo. It's free, takes two seconds, and it's the main way other developers find this project.
✨ Features
- 🌍 Comprehensive country dataset — ISO codes, slugs, geographic coordinates, and detailed metadata, stored right in your database
- 🗣️ Built-in translations for 9 languages (see table below) — no separate i18n package needed
- 🗄️ Everything lives in your database — link countries to any table via Eloquent, no runtime API calls
- ⚡ One Artisan command to install and seed everything
- ✅ Tested with Pest, CI-checked against Laravel 11, 12, and 13
🌍 Available Languages
| Language | Flag | Country | Number of Countries |
|---|---|---|---|
| Arabic | 🇸🇦 | Saudi Arabia | 25 |
| Dutch | 🇳🇱 | Netherlands | 3 |
| English | 🇬🇧 | United Kingdom | 67 |
| German | 🇩🇪 | Germany | 6 |
| Italian | 🇮🇹 | Italy | 4 |
| Portuguese | 🇧🇷 | Brazil | 9 |
| Russian | 🇷🇺 | Russia | 4 |
| Spanish | 🇪🇸 | Spain | 21 |
| Turkish | 🇹🇷 | Turkey | 2 |
Missing a language? Contributions are welcome — the guide explains how translations get reviewed.
🚀 Getting Started
Install via Composer:
composer require lwwcas/laravel-countries
Run the installer:
php artisan w-countries:install
That's it — the countries table is seeded and ready to query.
Production / CI (Laravel 11, 12, and 13)
In production, use --force to skip confirmation prompts:
php artisan w-countries:install --force
If migrations already ran during deploy and you only need the data:
php artisan w-countries:seed --languages=en,pt,es
To list the equivalent manual db:seed commands:
php artisan w-countries:seed --show-commands
See the Seeders documentation for the full production guide and manual seeder class reference.
🧑💻 Usage
use Lwwcas\LaravelCountries\Models\Country;
Country::whereIso('BR')->first();
Country::whereIsoAlpha3('BRA')->first();
Country::whereSlug('brasil')->first();
Looking for relationships, scopes, config, or translation helpers? → See the full documentation
🧪 Testing
composer test
🤝 Contributing
Contributions, translations, and bug reports are very welcome. Please read CONTRIBUTING.md before opening a pull request.
👥 Credits
- Lucas Duarte
- Saad Batwa — detailed review and corrections of Arabic country translations (PR #45)
- İlyas Özkurt — Turkish language translations (PR #36)
- All Contributors
📄 License
The MIT License (MIT). Please see LICENSE.md for more information.