stidges/laravel-country-flags
Laravel Country Flags
A Laravel wrapper for the stidges/country-flags package.
Installation
You can install the package via Composer:
$ composer require stidges/laravel-country-flags
The Laravel facade and service provider are registered through auto-discovery, so you can start using it out of the box!
Usage
This package publishes a Laravel facade for easier usage:
use CountryFlag;
echo CountryFlag::get('NL'); // "🇳🇱"
It also comes with a helper function that you can use!
echo country_flag('NL'); // "🇳🇱"
Aliasing
If you would like to make country codes available under a custom aliases, you can update the configuration file. First you should publish it:
$ php artisan vendor:publish --provider="Stidges\LaravelCountryFlags\CountryFlagsServiceProvider"
This will make the configuration file available under config/country-flags.php. You can update the 'aliases' section to add your custom aliases:
return [
'aliases' => [
'AA' => 'NL',
],
];
And it will be available for you to access:
echo country_flag('AA'); // "🇳🇱"
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email info@stidges.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Related Packages
Laravel package to convert country code (ISO 3166-1 alpha-2) to the correspondin...
Rinvex Countries is a simple and lightweight package for retrieving country deta...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v3.0.1 | ^8.2 | ^11.0| | MIT | |
| v3.0.0 | ^8.2 | ^11.0 | MIT | |
| v2.0.2 | ^7.3| | ^7.0| | MIT | |
| v2.0.1 | ^7.3| | ^7.0| | MIT | |
| v2.0.0 | ^7.3| | ^7.0| | MIT | |
| v1.0.4 | ^7.0 | ^5.5| | MIT | |
| v1.0.3 | ^7.0 | ^5.5| | MIT | |
| v1.0.2 | ^7.0 | ^5.5| | MIT | |
| v1.0.1 | ^7.0 | ^5.5 | MIT | |
| v1.0.0 | ~7.0 | ~5.5.0 | MIT |