Monarobase / country-list by Monarobase

List of all countries with names and ISO 3166-1 codes in all languages and data formats for Laravel
1,892,451
245
12
Package Data
Maintainer Username: Monarobase
Maintainer Contact: jonathan@monarobase.net (Jonathan Thuau)
Package Create Date: 2013-05-31
Package Last Update: 2024-03-13
Language: PHP
License: MIT
Last Refreshed: 2024-11-14 15:07:56
Package Statistics
Total Downloads: 1,892,451
Monthly Downloads: 43,485
Daily Downloads: 1,697
Total Stars: 245
Total Watchers: 12
Total Forks: 37
Total Open Issues: 3

Country List

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

Installation

Run composer require monarobase/country-list to pull down the latest version of Country List.

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

Monarobase\CountryList\CountryListServiceProvider::class,

Now add the alias.

'Countries' => Monarobase\CountryList\CountryListFacade::class,

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)

Get all countries

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

Get one country

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