Get expert guidance in a few days with a Laravel code review

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
Statamic logo

Statamic

The drop-in ready Laravel CMS you’re been waiting for. Go full-stack or headless, flat file or database – it’s up to you.

Statamic
Blastup logo

Blastup

Blastup provides social media enhancement services including buying Instagram likes, followers, and views, with features like instant delivery and a variety of packages to suit different needs.

Blastup
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
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
LoadForge logo

LoadForge

Scalable load testing for web apps & APIs. Simulate real-world traffic and identify breaking points and performance limits with powerful, scalable load tests designed for Laravel.

LoadForge
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit