PHPackages                             mohamed7sameer/countries-laravel - 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. mohamed7sameer/countries-laravel

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

mohamed7sameer/countries-laravel
================================

Countries for Laravel

v1(2y ago)00MITPHP

Since Oct 9Pushed 2y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

 Countries for Laravel
=======================

[](#----countries-for-laravel)

[![World Map](https://raw.githubusercontent.com/antonioribeiro/countries/master/docs/world-map-political-of-the-2013-nations-online-project-best.jpg)](https://raw.githubusercontent.com/antonioribeiro/countries/master/docs/world-map-political-of-the-2013-nations-online-project-best.jpg)

 [![Latest Stable Version](https://camo.githubusercontent.com/70f14be05605c0e74053dfb48dad12a8fa088e3c89332479fea9420245406c45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f68616d65643773616d6565722f636f756e74726965732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mohamed7sameer/countries-laravel) [![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](/antonioribeiro/countries/blob/master/LICENSE.md) [![Code Quality](https://camo.githubusercontent.com/ad5ad242d13c027d52cad6b538d393ffe48bf851d5ff8fe9c41e1d2b6cea787c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f616e746f6e696f7269626569726f2f636f756e74726965732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-yaml.com/g/antonioribeiro/countries-laravel/?branch=master) [![Build](https://camo.githubusercontent.com/193407db5cfaae82ea89fa16412775e84b8a70067e6bfa8d599418e96198f303/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f616e746f6e696f7269626569726f2f636f756e74726965732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-yaml.com/g/antonioribeiro/countries-laravel/?branch=master)

 [![Coverage](https://camo.githubusercontent.com/7dd2ebd795466ac5db7617039ce52bb60e1f39ec33b789c316f2dfed3abc1886/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f616e746f6e696f7269626569726f2f636f756e74726965732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-yaml.com/g/antonioribeiro/countries-laravel/?branch=master) [![PHP](https://camo.githubusercontent.com/e2a641a968a86c94821ba11798fe16798440086b13a7f78c4517d6c21554e1a8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e30253230253743253230372e31253230253743253230372e32253230253743253230372e332d627269676874677265656e2e7376673f7374796c653d666c6174)](https://travis-ci.org/antonioribeiro/countries-laravel) [![Downloads](https://camo.githubusercontent.com/9fbbba599d5d89bc2c7728ee1e5373d81a276aa854c21b86a82a985c4dc51eb6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f68616d65643773616d6565722f636f756e74726965732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mohamed7sameer/countries-laravel) [![StyleCI](https://camo.githubusercontent.com/e58c0eaf55551f27dacd7a7efa0a651c5b36e081c699b4ad79ac2395eae54fb9/68747470733a2f2f7374796c6563692e696f2f7265706f732f3131383435313630322f736869656c64)](https://styleci.io/repos/118451602)

### What does it gives you?

[](#what-does-it-gives-you)

This package has all sorts of information about countries:

infoitemstaxes32geometry maps248topology maps248currencies256countries266timezones423borders649flags1,570states4,526cities7,376timezones times81,153### Validation

[](#validation)

The validation is extending Laravel's validation, so you can use it like any other validation rules, like

```
/**
 * Store a new blog post.
 *
 * @param  Request  $request
 * @return Response
 */
public function store(Request $request)
{
    $this->validate($request, [
        'title' => 'required|unique:posts|max:255',
        'body' => 'required',
        'country' => 'country' //Checks if valid name.common
    ]);

    // The blog post is valid, store in database...
}
```

Which validation rules there is and what there name should be, can all be configured in the configuration file.

```
'validation' => [
    'rules' => [
	    'countryCommon' => 'name.common'
	]
]
```

By changing the configuration like this, we can now access the property `name.common`, by the validation rule `countryCommon`

You have to define all the validations rules in settings, only a few is defined by default, the default is

```
'rules' 	=> [
    'country' 			=> 'name.common',
    'cca2',
    'cca3',
    'ccn3',
    'cioc',
    'currencies'			=> 'ISO4217',
    'language',
    'language_short'	=> 'ISO639_3',
]
```

### Documentation

[](#documentation)

This package is a Laravel bridge, please refer to the [main package repository](https://github.com/antonioribeiro/countries) for more information and docs.

Requirements
------------

[](#requirements)

- PHP 7.0+
- Laravel 5.5+

Installing
----------

[](#installing)

Use Composer to install it:

```
composer require mohamed7sameer/countries-laravel

```

Publishing assets
-----------------

[](#publishing-assets)

You can publish configuration by doing:

```
php artisan vendor:publish --provider=Mohamed7sameer\\CountriesLaravel\\Package\\ServiceProvider

```

Usage
-----

[](#usage)

After installing you'll have access to the Countries Façade, and the package is based on Laravel Collections, so you basically have access to all methods in Collections, like

```
$france = Countries::where('name.common', 'France');
```

Flag routes
-----------

[](#flag-routes)

You can refer directly to an SVG flag by linking

```
/mohamed7sameer/countries/flag/download/.svg
/mohamed7sameer/countries/flag/file/.svg

```

Examples:

```
https://laravel.com/mohamed7sameer/countries/flag/download/usa.svg
https://laravel.com/mohamed7sameer/countries/flag/file/usa.svg

```

These routes can be turned off in the configuration file:

```
'routes' => [
    'enabled' => false,
]
```

Author
------

[](#author)

[Antonio Carlos Ribeiro](http://twitter.com/iantonioribeiro)

License
-------

[](#license)

Countries is licensed under the MIT License - see the `LICENSE` file for details

Contributing
------------

[](#contributing)

Pull requests and issues are more than welcome.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

943d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4fef2179c1f40e9fb23cbc8e790e27e68a3467c6e5e10c11f18df57f1fcdb4c2?d=identicon)[mohamed7sameer](/maintainers/mohamed7sameer)

---

Top Contributors

[![mohamed7sameer](https://avatars.githubusercontent.com/u/39682366?v=4)](https://github.com/mohamed7sameer "mohamed7sameer (1 commits)")

---

Tags

laravelcountriesflaggeometrystatescurrenciestimezonestaxescitiestopologyborders

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[pragmarx/countries

PHP Countries and Currencies

1.9k3.3M18](/packages/pragmarx-countries)[pragmarx/countries-laravel

Countries for Laravel

1471.1M2](/packages/pragmarx-countries-laravel)[nnjeim/world

Laravel countries, states, cities, currencies, languages and IP geolocation

970361.2k3](/packages/nnjeim-world)[dipeshsukhia/laravel-country-state-city-data

Country State City Data Provider

8230.8k](/packages/dipeshsukhia-laravel-country-state-city-data)[juanparati/iso-codes

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

17146.4k](/packages/juanparati-iso-codes)[usamamuneerchaudhary/country-city-state

Country City State Data Provider for Laravel 12+

242.6k](/packages/usamamuneerchaudhary-country-city-state)

PHPackages © 2026

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