PHPackages                             agoalofalife/geography - 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. agoalofalife/geography

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

agoalofalife/geography
======================

v0.5.0(5y ago)4125MITPHPPHP &gt;=7.2CI failing

Since Apr 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/agoalofalife/geography)[ Packagist](https://packagist.org/packages/agoalofalife/geography)[ RSS](/packages/agoalofalife-geography/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (7)Dependencies (6)Versions (9)Used By (0)

[EN](https://github.com/agoalofalife/geography/blob/master/README.md) | [RU](https://github.com/agoalofalife/geography/blob/master/README_RU.md)

**The geography of the regions**

[![Build Status](https://camo.githubusercontent.com/a899f7fc3dffd0d14abab52b2f3ff1ce713ae74854b8ba1d0b6ae0e313c654b8/68747470733a2f2f7472617669732d63692e6f72672f61676f616c6f66616c6966652f67656f6772617068792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/agoalofalife/geography) [![License](https://camo.githubusercontent.com/9ea374b71e8e6675a5028df0cd3af3845df6ca8c0152509f290b31e89eadba59/68747470733a2f2f706f7365722e707567782e6f72672f61676f616c6f66616c6966652f67656f6772617068792f6c6963656e7365)](https://packagist.org/packages/agoalofalife/geography) [![Twitter](https://camo.githubusercontent.com/9ac819ecc5e0d3189ad42edae67865c4c961c755e58780318669fd71f87c1321/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c2f68747470732f6769746875622e636f6d2f61676f616c6f66616c6966652f67656f6772617068792e7376673f7374796c653d736f6369616c267374796c653d706c6173746963)](https://twitter.com/intent/tweet?text=Wow:&url=%5Bobject%20Object%5D) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/126b1634f3d79337568028a6af848b3851d0818b00a4d5cd959db871f1fd8953/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61676f616c6f66616c6966652f67656f6772617068792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/agoalofalife/geography/?branch=master) [![Build Status](https://camo.githubusercontent.com/3725160a7711aa910d1cd40d4060e92aa224c25f09004b142229b7613274e26e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61676f616c6f66616c6966652f67656f6772617068792f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/agoalofalife/geography/build-status/master)

**What is it?**

This package solves the problem with the hierarchy of countries, regions, settlements in your database. A few commands in the console, you deploy all the necessary the country , regardless of country and language.

**The installation of the package**

For installation, you must run the command from composer

```
composer require agoalofalife/geography

```

**Data migration**

Run the command :

```
vendor/bin/geography install

```

Following the instructions step by step, continue to enter information.

1. Database selection

```
======================================
Please choose your database type :
  [ 0 ] mysql
  [ 1 ] postgres

```

2. Choice your host

```
Enter host for database , please : localhost

```

2. The name of the database:

```
Enter database name,  please : test

```

3. The user in the database:

```
Enter database username,  please : root

```

4. The password in the database (not shown):

```
Enter database password,  please :

```

5. To select the language:

```
Please select your native language :
  [0] ru
  [1] en
  [2] ua
  [3] be
  [4] es
  [5] fi
  [6] de
  [7] it
 >

```

5. Choose the country you want to migrate, for example I need a few countries (Australia and Brazil), respectively, I would need to enter : **AU,BR**

```
the list of countries you can see here 3166-1 alpha-2
you can specify multiple countries separated by commas
example EN, RU
Enter  the country you wish to migrate,  please :

```

After some time, depending on the volume of information you will see in my database three tables :

- Country
- Regions
- Сities

```
 You have just selected: AU,BR
 3/3 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

```

Congratulations to all successful!

**Integration with Laravel**

Since the environment Laravel uses for its tables Seeder and Migration, we can freely copy it to your project Laravel!

```
vendor/bin/geography migrate:laravel

```

After you get your files in a folder database and config.

To configure your language and countries you want to migrate, you must change the configuration file in config/geography.php :

```
return [
    //     Your native language
    //     0 — Russian,
    //     1 — Ukrainian,
    //     2 — Belarusian,
    //     3 — English,
    //     4 — Spanish,
    //     5 — Finnish,
    //     6 — German,
    //     7 — Italian.
    'locale'   => 0,

    // Country you wish to migrate
    // standard 3166-1 alpha-2
    // example RU,AU
   'country'  => 'RU',

    'nameTable' => [
        'country' => 'country',
        'regions' => 'regions',
        'cities'  => 'cities'
    ],
    'access_token' => ''
];

```

Next, you need to perform :

```
composer dump
php artisan migrate

php artisan db:seed
или для seeder :
php artisan db:seed --class=CountryTableSeeder
php artisan db:seed --class=RegionsTableSeeder
php artisan db:seed --class=CitiesTableSeeder

```

After you can easily remove the package and what not to worry!

\[[![yes](https://camo.githubusercontent.com/8885eca4e23e675fb3d8b67e5b7aa493927d6051ee901120cd3f0ef979f42a8c/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f325247686d4b58636c3056694d2f67697068792e676966)](https://camo.githubusercontent.com/8885eca4e23e675fb3d8b67e5b7aa493927d6051ee901120cd3f0ef979f42a8c/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f325247686d4b58636c3056694d2f67697068792e676966)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Recently: every ~98 days

Total

8

Last Release

1971d ago

PHP version history (2 changes)v0.1.0PHP &gt;=7.1

v0.3.0PHP &gt;=7.2

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

citiescountrygeographyphp-geographyregionsgeographycityregions

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/agoalofalife-geography/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k14.1M124](/packages/laravel-pulse)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[flarum/core

Delightfully simple forum software.

201.4M2.2k](/packages/flarum-core)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)

PHPackages © 2026

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