vcarreira / country-list
Ease access to localized countries provided by umpirsky package
Installs: 5 549
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: >= 5.5.9
- illuminate/support: ~5.1
- umpirsky/country-list: ^2.0
This package is not auto-updated.
Last update: 2024-11-09 20:01:52 UTC
README
A simple Laravel 5 service provider for the umpirsky/country-list localized countries arrays.
Installation
Add the following line to the require
section of composer.json
:
{ "require": { "vcarreira/country-list": "~1.0" } }
Setup
In /config/app.php
, add the following to providers
:
CountryList\CountryListServiceProvider::class,
and the following to aliases
:
'CountryList' => CountryList\Facades\CountryListFacade::class,
Usage
To use the service within your app, you need to retrieve it from the Laravel IoC
Container. The following example uses the app
helper to retrieve the list of countries in Portuguese.
$countries = app('countrylist')->all('pt_PT');
If the facade is registered within the aliases
section of the application configuration, you can also use the following code:
$countries = CountryList::all('pt_PT');