Country List

monarobase/country-list image

Country List stats

Downloads
1.4M
Stars
228
Open Issues
3
Forks
38

View on GitHub →

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

Country List

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

Installation

Run composer require monarobase/country-list.

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

Monarobase\CountryList\CountryListServiceProvider::class,

If needed, add the following alias as well.

'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');
});
Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Monarobase Country List Related Articles

RedBerry to Host Georgia's First Laravel Meetup in Tbilisi image

RedBerry to Host Georgia's First Laravel Meetup in Tbilisi

Read article
Use the New Fluent Helper to Work With Multi-dimensional Arrays in Laravel 11.2 image

Use the New Fluent Helper to Work With Multi-dimensional Arrays in Laravel 11.2

Read article
LangCountry is a Localization Package for Laravel image

LangCountry is a Localization Package for Laravel

Read article
Writing and debugging Eloquent queries with Tinkerwell image

Writing and debugging Eloquent queries with Tinkerwell

Read article
Lemon Squeezy for Laravel image

Lemon Squeezy for Laravel

Read article
Laravel Security 101: Never trust your users image

Laravel Security 101: Never trust your users

Read article
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
The Certification of Competence for Laravel logo

The Certification of Competence for Laravel

A community-driven, proctored assessment across 4 levels designed to validate real-world Laravel knowledge, from Junior to mastery-level Artisan. Official Vue.js, Official Nuxt, Angular, React, JS certifications also available.

The Certification of Competence for Laravel
Typesense Search logo

Typesense Search

Typesense is an open source, blazing-fast search engine, optimized for helping you build delightful search experiences for your sites and apps. Natively integrated with Laravel Scout.

Typesense Search
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm