LaravelPackages.net
Acme Inc.
Toggle sidebar
tightr/laravel-country-flags

A Laravel 5.6 wrapper for the stidges/country-flags package

693
0
v1.0.2
About tightr/laravel-country-flags

tightr/laravel-country-flags is a Laravel package for a laravel 5.6 wrapper for the stidges/country-flags package. It currently has 0 GitHub stars and 693 downloads on Packagist (latest version v1.0.2). Install it with composer require tightr/laravel-country-flags. Discover more Laravel packages by tightr or browse all Laravel packages to compare alternatives.

Last updated

Laravel Country Flags

Latest Version on Packagist Software License Build Status Quality Score Total Downloads

A Laravel 5.6 wrapper for the stidges/country-flags package.

Installation

You can install the package via Composer:

$ composer require tightr/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="Tightr\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 [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Star History Chart