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

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

kenyalang/countries
===================

A package to get list of countries

v1.1.0(3y ago)04[2 PRs](https://github.com/Kenyalang/countries/pulls)MITPHPPHP ^8.1

Since Jul 13Pushed 3y agoCompare

[ Source](https://github.com/Kenyalang/countries)[ Packagist](https://packagist.org/packages/kenyalang/countries)[ Docs](https://github.com/kenyalang/countries)[ RSS](/packages/kenyalang-countries/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (13)Versions (5)Used By (0)

A package to get list of countries
==================================

[](#a-package-to-get-list-of-countries)

[![Latest Version on Packagist](https://camo.githubusercontent.com/789edac661f04146f902b4d70a5f0ac72feafd2f957653fe24f753f1c240f28b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b656e79616c616e672f636f756e74726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kenyalang/countries)[![GitHub Tests Action Status](https://camo.githubusercontent.com/60c0955b5e6616d533616d4cbde6a01f36646988e220d3625d0feafbec923a4b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6b656e79616c616e672f636f756e74726965732f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/kenyalang/countries/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/96e9bdd7fa804acbe414260bcfd20a435fcb6ffd93c3446ffc30760f13c2005a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6b656e79616c616e672f636f756e74726965732f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/kenyalang/countries/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/3c888d784cfef9971a21a15b4bbd08f39f36b88acb2f56ede6f9dc4b461bf7db/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b656e79616c616e672f636f756e74726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kenyalang/countries)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require kenyalang/countries
```

To publish the `config` file, you can use the following command:

```
php artisan vendor:publish --provider="\Kenyalang\Countries\CountriesServiceProvider" --tag=config
```

Usage
-----

[](#usage)

Run the migrations to create and populate the `countries` and `states` table.

```
php artisan migrate
```

By default, the `countries` will be inactive. To enable them update your `.env`.

```
ENABLE_ALL_COUNTRIES=true
```

To manually enable a country, you may query the desired country and use the `activate` function.

```
\Kenyalang\Countries\Models\Country::where('name', 'United States')->activate();
```

To disable a country, you may query the desired country and use the `deactivate` function.

```
\Kenyalang\Countries\Models\Country::where('name', 'United States')->deactivate();
```

To query only active countries, use the `active` scope.

```
\Kenyalang\Countries\Models\Country::active()->get();
```

Add the following trait to your model to use the `countries` and `states` table:

```
class User extends Model
{
    use \Kenyalang\Countries\Traits\HasCountry;
}
```

To get the locale of a model use the `withLocale` scope:

```
User::withLocale()->first();
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Scalia Abel](https://github.com/scaabel)
- [Drahan](https://github.com/dr5hn)

The list of countries was taken from [here](https://github.com/dr5hn/countries-states-cities-database). Do check it out.

License
-------

[](#license)

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

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

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 ~2 days

Total

2

Last Release

1448d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/369294887127da70a6ef30197d5d0dd7d8401ace8c4fcbc2244fa45ff5b316f5?d=identicon)[scaabel](/maintainers/scaabel)

---

Top Contributors

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

---

Tags

countrieshacktoberfestlaravellaravelcountriesKenyalang

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M46](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/laravel-wallet

A simple wallet implementation for Laravel

26611.9k](/packages/stephenjude-laravel-wallet)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

199.4k](/packages/tarfin-labs-event-machine)

PHPackages © 2026

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