monarobase/country-list

List of all countries with names and ISO 3166-1 codes in all languages and data formats for Laravel 4

Installs: 10 284

Dependents: 0

Stars: 45

Watchers: 3

Forks: 9

Open Issues: 2

Language: PHP

1.2.3 2015-05-12 13:41 UTC

README

Country List is a package for Laravel 4 which lists all countries with names and ISO 3166-1 codes in all languages and data formats.

Installation

Add monarobase/country-list to composer.json.

"monarobase/country-list": "dev-master"

Run composer update to pull down the latest version of Country List.

Now open up app/config/app.php and add the service provider to your providers array.

'providers' => array(
    'Monarobase\CountryList\CountryListServiceProvider',
)

Now add the alias.

'aliases' => array(
    'Countries' => 'Monarobase\CountryList\CountryListFacade',
)

Usage

  • Locale (en, en_US, fr, fr_CA...)
  • Format (csv, flags.html, html, json, mysql.sql, php, postgresql.sql, sqlite.sql, sqlserver.sql, txt, xml, yaml)
  • Data source (icu, cldr)

Get all countries

Route::get('/', function()
{
    return Countries::getList('en', 'json', 'cldr');
});

Get one country

Route::get('/', function()
{
    return Countries::getOne('RU', 'en', 'cldr');
});