PHPackages                             lykegenes/laravel-countries - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lykegenes/laravel-countries

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lykegenes/laravel-countries
===========================

Get informations about countries.

2.0.1(4y ago)725.0k—3.1%7[1 PRs](https://github.com/Lykegenes/laravel-countries/pulls)1MITPHP

Since Feb 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Lykegenes/laravel-countries)[ Packagist](https://packagist.org/packages/lykegenes/laravel-countries)[ Docs](https://github.com/Lykegenes/laravel-countries)[ RSS](/packages/lykegenes-laravel-countries/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (8)Used By (1)

Laravel Countries
=================

[](#laravel-countries)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2d178daa90325568b16559195ad8bbea970c1106bc4a60b240754bdd5939a67d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c796b6567656e65732f6c61726176656c2d636f756e74726965732e737667)](https://packagist.org/packages/lykegenes/laravel-countries)[![Software License](https://camo.githubusercontent.com/e1129ed197cb80ba0bbdb27cacff1c60413ab74dd53c9777448954ab790ef899/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c796b6567656e65732f6c61726176656c2d636f756e74726965732e737667)](LICENSE.md)[![Build Status](https://github.com/patricksamson/laravel-countries/workflows/Run%20Tests%20-%20Current/badge.svg?branch=master)](https://github.com/patricksamson/laravel-countries/workflows/Run%20Tests%20-%20Current/badge.svg?branch=master)[![Total Downloads](https://camo.githubusercontent.com/847493ff0f6c2ada1d3fdf571ee2344f43976dda6f8c595dbb0a094503b3cb6f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c796b6567656e65732f6c61726176656c2d636f756e74726965732e737667)](https://packagist.org/packages/lykegenes/laravel-countries)

This package gives you access effortlessly to data from every country.

Install
-------

[](#install)

Via Composer

```
composer require lykegenes/laravel-countries
```

Usage
-----

[](#usage)

You can search for a specific country using one of the following unique country codes :

```
$country = \Countries::getByAlpha2Code('CA'); // 2-letters country code from ISO3166
$country = \Countries::getByAlpha3Code('CAN'); // 3-letters country code from ISO3166
$country = \Countries::getByNumericCode(124); // 3-digits country code from ISO3166
```

You can retrieve an array of countries using their region of one of their currencies :

```
$countries = \Countries::getByCurrency('CAD'); /// A 3-letters currency code

// Search by region
$countries = \Countries::getByRegion(\Countries::$REGION_AFRICA);
$countries = \Countries::getByRegion(\Countries::$REGION_AMERICAS);
$countries = \Countries::getByRegion(\Countries::$REGION_ANTARCTICA);
$countries = \Countries::getByRegion(\Countries::$REGION_ASIA);
$countries = \Countries::getByRegion(\Countries::$REGION_EUROPE);
$countries = \Countries::getByRegion(\Countries::$REGION_OCEANIA);
```

Results will be returned as Country objects. These objects have the following helper methods :

```
$country = \Countries::getByAlpha3Code('CAN');

$country->getAlpha2Code();      // 'CA'
$country->getAlpha3Code();      // 'CAN'
$country->getNumericCode();     // 124
$country->getOfficialName();    // 'Canada'

$country->getAttributes();      // An array of all the raw attributes.
```

It is also possible to generate simple PHP array that can be used to generate an HTML select input.

```
// All parameters are optionnal. These are the defaults.
// $key             The country attribute to use as key. (default: 'cca3', 3-letters country code from ISO3166)
// $official        True for the offical country name, False for the common name. (default: false)
// $localization    A 3-letter locale code to try to translate. Will default to English if it`s missing. (default: null)
$countries = \Countries::getListForDropdown('cca3', false, 'fra');

//This will return the following
[
    'CAN' => 'Canada',
    'USA' => 'États-Unis',
    ...
]
```

Credits
-------

[](#credits)

- [Patrick Samson](https://github.com/lykegenes)
- [Mohammed Le Doze](https://github.com/mledoze) for compiling all this data in [this repository](https://github.com/mledoze/countries).
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~453 days

Recently: every ~566 days

Total

6

Last Release

1473d ago

Major Versions

1.1.2 → 2.0.02020-10-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/00961241bfba1f54c7c590fad6b3f8ece27d3783727f6371f69b9cd560df93ab?d=identicon)[Lykegenes](/maintainers/Lykegenes)

---

Top Contributors

[![patricksamson](https://avatars.githubusercontent.com/u/1416027?v=4)](https://github.com/patricksamson "patricksamson (81 commits)")

---

Tags

hacktoberfestlaravelpackagelaravelcountries

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lykegenes-laravel-countries/health.svg)

```
[![Health](https://phpackages.com/badges/lykegenes-laravel-countries/health.svg)](https://phpackages.com/packages/lykegenes-laravel-countries)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[webpatser/laravel-countries

Modern Laravel Countries package providing ISO 3166-2, ISO 3166-3, currency, capital and more for all countries. Compatible with Laravel 11.x and 12.x.

8272.8M8](/packages/webpatser-laravel-countries)[dougsisk/laravel-country-state

Country &amp; state helper for Laravel.

1681.7M](/packages/dougsisk-laravel-country-state)[dipeshsukhia/laravel-country-state-city-data

Country State City Data Provider

8230.8k](/packages/dipeshsukhia-laravel-country-state-city-data)[stidges/laravel-country-flags

A Laravel wrapper for the stidges/country-flags package

28134.6k](/packages/stidges-laravel-country-flags)[juanparati/iso-codes

A PHP library that provides ISO codes, currencies, languages, timezones and additional geopolitical information

17146.4k](/packages/juanparati-iso-codes)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
