PHPackages                             ekhrystenko/country-tools - 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. ekhrystenko/country-tools

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

ekhrystenko/country-tools
=========================

A simple Laravel package for working with country data (code, name, flag, phone code, currency) with caching support.

v1.0.1(5mo ago)00MITPHPPHP ^8.3

Since Nov 12Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/ekhrystenko/country-tools)[ Packagist](https://packagist.org/packages/ekhrystenko/country-tools)[ RSS](/packages/ekhrystenko-country-tools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

ekhrystenko/country-tools
=========================

[](#ekhrystenkocountry-tools)

The `ekhrystenko/country-tools` package provides services to retrieve country data, such as country code, name, flag, phone code, and currency. The package uses repositories to store and access country data and offers caching services to improve performance.

**Supported versions:**

- [Laravel ^11.x](https://laravel.com/docs/11.x)
- [PHP ^8.3](https://www.php.net/releases/8.3/uk.php)
- [Packagist](https://packagist.org/packages/ekhrystenko/country-tools)

**Author:**

- [Eugene Khrystenko](https://github.com/ekhrystenko) ()

---

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

[](#installation)

```
  composer require ekhrystenko/country-tools
```

Generating the countries.json File
----------------------------------

[](#generating-the-countriesjson-file)

To generate the JSON file containing country data, use the GenerateCountryJson Artisan command. This command fetches country data from an API and generates the JSON file.

```
  php artisan country:generate-json
```

Using Environment Variable for File Path
----------------------------------------

[](#using-environment-variable-for-file-path)

You can configure the path to the countries.json file using the COUNTRY\_JSON\_PATH environment variable in your .env file. If COUNTRY\_JSON\_PATH is not set, the package will use the default internal file path.

```
COUNTRY_JSON_PATH=/path/to/project/storage/countries.json

```

Usage in Your Project
---------------------

[](#usage-in-your-project)

After installing the package, you can use the Country facade:

```
use Eugene\CountryTools\Facades\Country;

$codes = Country::getCountryCodes();
$country = Country::getCountry('US');
$name = Country::getName('US');
$flag = Country::getFlag('US');
$phoneCode = Country::getPhoneCode('US');
$currency = Country::getCurrency('US');

```

Available Methods
-----------------

[](#available-methods)

```
Country::getCountryCodes()	Returns all country codes
Country::getCountry($code)	Returns full country data for a specific code
Country::getName($code)	        Returns the country name
Country::getFlag($code) 	Returns the country flag emoji or image
Country::getPhoneCode($code)    Returns the phone code for the country
Country::getCurrency($code)	Returns the currency for the country

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance69

Regular maintenance activity

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

178d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ccb1420e571606dcd0a18ccf16482564a96907b14be6e378e2e8ed7e01cc86aa?d=identicon)[ekhrystenko](/maintainers/ekhrystenko)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ekhrystenko-country-tools/health.svg)

```
[![Health](https://phpackages.com/badges/ekhrystenko-country-tools/health.svg)](https://phpackages.com/packages/ekhrystenko-country-tools)
```

###  Alternatives

[barryvdh/laravel-ide-helper

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

14.9k123.0M683](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M210](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M858](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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