Download the PHP package danielebuso/laravel-countries without Composer
On this page you can find all versions of the php package danielebuso/laravel-countries. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download danielebuso/laravel-countries
More information about danielebuso/laravel-countries
Files in danielebuso/laravel-countries
Package laravel-countries
Short Description A Laravel package providing country data with multilanguage support using Sushi
License MIT
Homepage https://github.com/danielebuso/laravel-countries
Informations about the package laravel-countries
Laravel Countries
A Laravel package that provides an easy way to query and browse country data with multilanguage support using Sushi. Unlike other country packages, this one includes country names in multiple languages, making it perfect for international applications.
This package uses data structure inspired by stefangabos/world_countries and leverages Sushi to provide a seamless Eloquent-like interface for static country data.
Features
- π Complete ISO 3166-1 list with 249 entities including countries, territories, and dependencies
- π Multilanguage support - Country names in multiple languages (English, Spanish, French, Italian, German, Croatian, and more)
- π Query countries using Laravel's Eloquent ORM
- β‘ Fast performance with Sushi's in-memory caching
- π― Simple and intuitive API
- π¦ Zero database migrations required
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Usage
What's Included
This package includes the complete ISO 3166-1 standard with 249 entities:
- Sovereign states: All 193 UN member states plus Vatican City, Palestine, Kosovo, Taiwan
- Territories: Puerto Rico, Guam, U.S. Virgin Islands, American Samoa, etc.
- Dependencies: Greenland, Bermuda, French Polynesia, Faroe Islands, etc.
- Special Administrative Regions: Hong Kong, Macau
- Other entities: Antarctica, Γ land Islands, and more
This comprehensive list ensures you have access to all officially recognized ISO codes, not just UN member states.
Basic Usage
Multilanguage Support
The package includes built-in support for multiple languages. Country names are available in:
- English (en) - Default
- Spanish (es)
- French (fr)
- Italian (it)
- German (de)
- Croatian (hr)
Query Examples
Available Fields
Each country model has the following attributes:
id- ISO 3166-1 numeric codealpha2- ISO 3166-1 alpha-2 code (e.g., 'US', 'IT', 'FR')alpha3- ISO 3166-1 alpha-3 code (e.g., 'USA', 'ITA', 'FRA')name- Country name in English
Why This Package?
While there are several Laravel packages that provide country data, this package stands out because:
- Multilanguage Support: Unlike most packages, this one includes country names in multiple languages out of the box
- No Database Required: Uses Sushi to work with static data without migrations
- Familiar API: Works just like any Eloquent model
- Actively Maintained: Built on modern Laravel standards
- Lightweight: Minimal dependencies and fast performance
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Daniele Buso
- All Contributors
- Data structure inspired by stefangabos/world_countries
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-countries with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0|^11.0|^12.0
calebporzio/sushi Version ^2.5