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

ActiveLibrary

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 1mo ago

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 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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

Every ~2 days

Total

2

Last Release

1393d 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

[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

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