A Laravel 5.5 wrapper for the stidges/country-flags package.
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!
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'); // "🇳🇱"
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'); // "🇳🇱"
Please see CONTRIBUTING for details.
If you discover any security related issues, please email info@stidges.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.