New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

tariq86/country-list

List of all countries with names and ISO 3166-1 codes in all languages and data formats for Laravel
15,950 7
Install
composer require tariq86/country-list
Latest Version:3.1.1
PHP:^7.1
Laravel:5 – 8
License:MIT
Last Updated:Dec 9, 2024
Links: GitHub  ·  Packagist
Maintainer: tariq86

Country List

Build Status codecov

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

Installation

Require package via Composer: composer require tariq86/country-list

As of version 2.0.0 of this package, Laravel 5.8 is the minimum required version, so you do not need to perform any further actions. If you are using an older version of Laravel, you will also need to use an older version of this package (i.e. 1.3.1).

Usage

  • Locale (en, en_US, fr, fr_CA...)
    • If no locale is given (or if it is set to null), then it will default to 'en'
  • 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');
});

Related Packages

cosninix/sin

Simple internationalization for Laravel

2,851 0
dougsisk/laravel-country-state

Country & state helper for Laravel.

2,234,296 168
duxthefux/laravel-intl

Easy to use internationalization functions for Laravel

94,901 0
myqaa/laravel-intl

Easy to use internationalization functions for Laravel

22,477 0
marvinrabe/laravel-intl

Easy to use internationalization functions for Laravel

20,996 5

Version History

Version Released PHP Laravel License
3.1.1 ^7.1 ^5.8|^6|^7|^8 MIT
3.1.0 ^7.1 ^5.8|^6|^7|^8 MIT
3.0.0 ^7.1 ^5.8|^6|^7|^8 MIT
2.0.0 ^7.1 ^5.8|^6|^7 MIT
v1.3.1 >=5.4.0 MIT