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

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

someshwer/world-countries
=========================

This package provides all countries, states, cities names and also ISO, STD codes and tomezones.

3.5.8(5y ago)06MITPHPPHP &gt;=7.3CI failing

Since May 26Pushed 5y ago1 watchersCompare

[ Source](https://github.com/bsomeshwer/world-countries)[ Packagist](https://packagist.org/packages/someshwer/world-countries)[ Docs](https://github.com/bsomeshwer/world-countries)[ RSS](/packages/someshwer-world-countries/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (21)Used By (0)

Laravel - World Countries
=========================

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

[![Build Status](https://camo.githubusercontent.com/2bd60f381d3b91c094860e4aabd2b393d52862e22454761070cfe6c8bb8742b1/68747470733a2f2f7472617669732d63692e636f6d2f62736f6d6573687765722f776f726c642d636f756e74726965732e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/bsomeshwer/world-countries)[![Code Quality](https://camo.githubusercontent.com/6134eeca524b445549038ee63909258019f41d7d1311097c3e7590244bb884b7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f62736f6d6573687765722f776f726c642d636f756e74726965732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/bsomeshwer/world-countries/?branch=master)[![Code Quality Score](https://camo.githubusercontent.com/498aceb774e865b88033cb29429e833a03c0270f659dcb8651de9a284d6bc030/68747470733a2f2f7777772e636f64652d696e73706563746f722e636f6d2f70726f6a6563742f383533342f73636f72652f737667)](https://camo.githubusercontent.com/498aceb774e865b88033cb29429e833a03c0270f659dcb8651de9a284d6bc030/68747470733a2f2f7777772e636f64652d696e73706563746f722e636f6d2f70726f6a6563742f383533342f73636f72652f737667)[![Code Grade](https://camo.githubusercontent.com/224a216b8555a0c06d70b1251f19b136239b044b35cf1992ef0ca99725295937/68747470733a2f2f7777772e636f64652d696e73706563746f722e636f6d2f70726f6a6563742f383533342f7374617475732f737667)](https://camo.githubusercontent.com/224a216b8555a0c06d70b1251f19b136239b044b35cf1992ef0ca99725295937/68747470733a2f2f7777772e636f64652d696e73706563746f722e636f6d2f70726f6a6563742f383533342f7374617475732f737667)[![StyleCI](https://camo.githubusercontent.com/7ca330f4e1ef751e360316d0f6fefd4b5ae8a613943b3b406e51b8a1d494eb78/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3133343934383138332f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/134948183)[![Code Intelligence Status](https://camo.githubusercontent.com/41416e28ff9fed3e58a26bf6f6e36477a3b4dd89846d2ed5425ac4a78c26f3f0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62736f6d6573687765722f776f726c642d636f756e74726965732f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)[![Coverage Status](https://camo.githubusercontent.com/c7731c0e07629b3263e8d3fed8f0911d3ee3d462277b49d0d633b16c8ba8a4ca/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f62736f6d6573687765722f776f726c642d636f756e74726965732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/bsomeshwer/world-countries?branch=master)

[![codecov](https://camo.githubusercontent.com/434ed8dea181f706e0800a030b401a3d7378407904db99aceb723f03fdab74a5/68747470733a2f2f636f6465636f762e696f2f67682f62736f6d6573687765722f776f726c642d636f756e74726965732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/bsomeshwer/world-countries)[![License](https://camo.githubusercontent.com/6dff9995379a7cc8b61e68e888105ce16434532968b889030da3dfd11cb7671f/68747470733a2f2f706f7365722e707567782e6f72672f736f6d6573687765722f776f726c642d636f756e74726965732f6c6963656e7365)](//packagist.org/packages/someshwer/world-countries)[![Latest Stable Version](https://camo.githubusercontent.com/bc5e2c482670c879d42815ad494111122cfff77c37b30f3a12ec57fe11983f8d/68747470733a2f2f706f7365722e707567782e6f72672f736f6d6573687765722f776f726c642d636f756e74726965732f76)](//packagist.org/packages/someshwer/world-countries)[![Latest Unstable Version](https://camo.githubusercontent.com/68ee1c3b49288f089e769633957436dc00f55aafb43ef602c4ba3b80cebafa64/68747470733a2f2f706f7365722e707567782e6f72672f736f6d6573687765722f776f726c642d636f756e74726965732f762f756e737461626c65)](//packagist.org/packages/someshwer/world-countries)[![Total Downloads](https://camo.githubusercontent.com/6d867d248d223f16432da5d55f1554e49e7bd71ca8c916fa59047112121a58f4/68747470733a2f2f706f7365722e707567782e6f72672f736f6d6573687765722f776f726c642d636f756e74726965732f646f776e6c6f616473)](//packagist.org/packages/someshwer/world-countries)[![composer.lock](https://camo.githubusercontent.com/bb5dca615c6794a361a5babae2a6ab0d4b34a229367c01f3be5b680713dadcd6/68747470733a2f2f706f7365722e707567782e6f72672f736f6d6573687765722f776f726c642d636f756e74726965732f636f6d706f7365726c6f636b)](//packagist.org/packages/someshwer/world-countries)

Laravel WorldCountries is a bundle for Laravel, providing useful world information that is all country names, timezones, ISO country codes, STD codes of countries etc.

This package only provides countries data that is all country names for all most 195 countries over the world along with continent names, ocean names, union territories names, world wonders names, ISO codes and ISO information, timezones and timezones information, and currencies and currency codes and symbols information.

Also provides country wise states and state wise cities information.

```
Note: As of now the support for database option is not there, It will be implemented soon.
      (See this area for new updates.)

```

\*\*Please note that always use latest version of this package and must use Laravel 5 and above versions only, as this package may not properly work with older versions of Laravel.

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

[](#installation)

Open terminal, go to root directory and run the following command:

```
composer require someshwer/world-countries

```

The package will be installed.

Add `Someshwer\WorldCountries\WorldDataServiceProvider::class` class to `providers` array in `config/app.php` file.

```
Ex:-

'providers' => [
    ...,
    ...,
    Someshwer\WorldCountries\WorldDataServiceProvider::class,
]

```

Now add the alias to `aliases` array in config/app.php`.

```
Ex:-

'aliases' => [
     ...,
     ...,
     'World' => Someshwer\WorldCountries\Facades\World::class,
]

```

You can start by publishing the configuration.

```
$ php artisan vendor:publish --provider="Someshwer\WorldCountries\WorldDataServiceProvider"

```

That's it !! You are done with package installation...

Usage:
------

[](#usage)

Next use the package as follows:

```
1. World::countries();

```

It returns all the country names in the world.

```
2. World::searchCountry('xx');

```

Where the parameter 'xx' is the search string. You can search the countries by search string. If search string is not provided then all country names will be returned.

```
3. World::continents();

```

It returns all continents names.

```
4. World::oceans();

```

It returns all oceans names in the world.

```
5. World::unionTerritories();

```

It returns all union territories names in the world.

```
6. World::wonders();

```

It returns all wonders names in the world.

```
7. World::isoCodes();

```

It returns all iso codes of the countries in the world. You can also get paginated result for iso codes. If you want pagination for iso codes then just set 'iso' option to TRUE in config/world.php configuration file. Also you can set how many number of records you want to display per page. Just go through config options available in config/world.php file.

When you use pagination, you must give the page number from the request url. For example: You are calling iso codes like World::isoCodes(). For pagination you must send the parameter as World::isoCodes($request-&gt;get('page')) and url should be like ''.

```
8. World::regions();

```

It returns all regions names for iso codes.

```
9. World::isoInfoByCountryName('country_name');

```

Where the parameter 'country\_name' is the country name. You can search iso information by country name. If country name is not provided or the country name provided as parameter is not matched then in those both cases an empty array will be returned.

```
10. World::isoInfoByCode('country_code');

```

Where the parameter 'country\_code' is the country code. You can search iso information by country code. If country code is not provided or the country code provided as parameter is not matched then in those both cases an empty array will be returned.

```
11. World::isoCodesByRegion('region');

```

Where the parameter 'region' is the region name. You can search iso information by region name. If region name is not provided or the region name provided as parameter is not matched then in those both cases an empty array will be returned.

```
12. World::searchIsoCodes('xx');

```

Where the parameter 'xx' is the search string. You can search iso information by any search string. If search string is not provided or the search string provided as parameter is not matched then in those both cases an empty array will be returned.

```
13. World::timezones();

```

It returns all timezones information in the world.

```
14. World::timezoneRegions();

```

It returns all timezone region names in the world.

```
15. World::timezonesByRegion('region_name');

```

It returns all timezone information for the provided region. If region name provided is not matched or if region name is null in that case an empty array will be returned.

```
16. World::searchTimezone('xx');

```

You can search timezones by either country name or timezone name. Where the parameter 'xx' is the search string. You can search timezones by any search string. If search string is not provided or the search string provided as parameter is not matched then in those both cases an empty array will be returned.

```
17. World::currencies();

```

It returns all currency names and their information like country name, country code, currency code, and currency symbol for almost currencies in the world.

```
18. World::searchCurrency('xx');

```

You can search the currency by either country name or currency name. Where the parameter 'xx' is the search string. You can search currencies by any search string. If search string is not provided or the search string provided as parameter is not matched then in those both cases an empty array will be returned.

```
19. World::currencyByCountryName('country_name');

```

You can search the currency by country name. If the country name provided as parameter is null or if it is not matched with any value in the database files, in that case an empty array will be returned.

```
20. World::currencyByCountryCode('country_code');

```

You can search the currency by country code. If the country code provided as parameter is null or if it is not matched with any value in the database, in that case an empty array will be returned as response.

```
21. World::currencyByCurrencyName('currency_name');

```

You can search the currency by currency name. If the currency name provided as parameter is null or if it is not matched with any value in the database files, in that case an empty array will be returned.

```
22. World::currencyByCountryCode('currency_code');

```

You can search the currency by currency code. If the currency code provided as parameter is null or if it is not matched with any value in the database, in that case an empty array will be returned as response.

```
23. World::stdCodes();

```

It returns all the STD codes for all countries.

```
24. World::searchStdCodes('xx');

```

You can search the STD code by search string. If the search string provided as parameter is null or if it is not matched with any value in the database, in that case an empty array will be returned as response.

```
25. World::stdCodeByCountryName('country_name');

```

You can search the STD code by country name. If the country name provided as parameter is null or if it is not matched with any value in the database, in that case an empty array will be returned as response.

```
26. World::stdCodeByCountryCode('country_code');

```

You can search the STD code by country code. If the country code provided as parameter is null or if it is not matched with any value in the database, in that case an empty array will be returned as response.

```
27. World::states();

```

It returns all state names along with it's country name. You can also get paginated result for states. If you want pagination for states then just set 'states' option to TRUE in config/world.php configuration file. Also you can set how many number of records you want to display per page. Just go through config options available in config/world.php file.

When you use pagination, you must give the page number from the request url. For example: You are calling states like World::states(). For pagination you must send the parameter as World::states($request-&gt;get('page')) and url should be like ''.

```
28. World::searchStates('search_key');

```

You can search states by any search string. If the search key provided as parameter is null or if it is not matched with any value in the database, an empty array will be returned as response.

```
29. World::countriesForStates('country_code');

```

It returns all country names in case you want to search states by a country.

```
30. World::getStatesByCountry('country_name');

```

You can search the states by a country name. If the country name provided as parameter is null or if it is not matched with any value in the database, an empty array will be returned as response.

```
31. World::cities();

```

It returns all city names along with state and country to which it belong to. You can also get paginated result for cities. If you want pagination for cities then just set 'cities' option to TRUE in config/world.php configuration file. Also you can set how many number of records you want to display per page. Just go through configuration options available in config/world.php file.

When you use pagination, you must give the page number from the request url. For example: You are calling cities like World::cities(). For pagination you must send the parameter as World::cities($request-&gt;get('page')) and url should be like ''.

For pagination: Url must be similar to "" cities() function calling must be like "return World::cities($request-&gt;get('page'));". Otherwise pagination may not work properly.

```
32. World::searchCities('search_key');

```

You can search the cities by any search string. If the search key provided as parameter is null or if it is not matched with any value in the database, then an empty array will be returned as response.

```
33. World::statesForCities();

```

It returns all state names in case you want to search cities by a state.

```
34. World::countriesForCities();

```

It returns all country names in case you want to search cities by a country.

```
35. World::getCitiesByStateName('state_name');

```

You can search the cities by a state. If the state name provided as parameter is null or if it is not matched with any value in the database, then an empty array will be returned as response.

```
36. World::getCitiesByCountryName('country_name');

```

You can search cities by a country. If the country name provided as parameter is null or if it is not matched with any value in the database, an empty array will be returned as response.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 98.7% 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 ~49 days

Recently: every ~164 days

Total

16

Last Release

2173d ago

Major Versions

1.6.0 → 2.1.92018-08-03

2.3.9 → 3.4.82018-08-08

2.4.9 → 3.4.92018-08-08

PHP version history (2 changes)1.0.2PHP ^5.4 || ^7.0

3.5.7PHP &gt;=7.3

### Community

Maintainers

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

---

Top Contributors

[![bsomeshwer](https://avatars.githubusercontent.com/u/39646194?v=4)](https://github.com/bsomeshwer "bsomeshwer (74 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

citiescountriescurrencyisocodeslaravelphpstatestimezonescountriesworldcities

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[pragmarx/countries

PHP Countries and Currencies

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

Rinvex Countries is a simple and lightweight package for retrieving country details with flexibility. A whole bunch of data including name, demonym, capital, iso codes, dialling codes, geo data, currencies, flags, emoji, and other attributes for all 250 countries worldwide at your fingertips.

1.7k7.4M48](/packages/rinvex-countries)[league/iso3166

ISO 3166-1 PHP Library

69536.3M116](/packages/league-iso3166)[pragmarx/countries-laravel

Countries for Laravel

1471.1M2](/packages/pragmarx-countries-laravel)[dipeshsukhia/laravel-country-state-city-data

Country State City Data Provider

8230.8k](/packages/dipeshsukhia-laravel-country-state-city-data)[gerardojbaez/geodata

Laravel 5.2 package that provides basic geographical data like Countries, Regions and Cities.

3211.9k](/packages/gerardojbaez-geodata)

PHPackages © 2026

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