PHPackages                             pixxet/laravel-geoip-world-cities - 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. pixxet/laravel-geoip-world-cities

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

pixxet/laravel-geoip-world-cities
=================================

Laravel GeoIP World Cities provides MaxMind Free World Cities Database for laravel applications.

2.3.1(9y ago)0145MITPHPPHP ~5.5|~7.0

Since Mar 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/pixxet/laravel-geoip-world-cities)[ Packagist](https://packagist.org/packages/pixxet/laravel-geoip-world-cities)[ Docs](https://github.com/pixxet/laravel-geoip-world-cities)[ RSS](/packages/pixxet-laravel-geoip-world-cities/feed)WikiDiscussions master Synced 2mo ago

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

laravel-geoip-world-cities (Laravel 5)
======================================

[](#laravel-geoip-world-cities-laravel-5)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cd122b1dc61e9e9bdfcfb2a15a5fa1b2cae21c6661b753694ea770b617e5b7a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7069787865742f6c61726176656c2d67656f69702d776f726c642d6369746965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pixxet/laravel-geoip-world-cities)[![Latest Unstable Version](https://camo.githubusercontent.com/e60ee0eec75f5bb58fa10bb3ef324623c382630b0a4a0ea210dd144383cb11d1/68747470733a2f2f706f7365722e707567782e6f72672f7069787865742f6c61726176656c2d67656f69702d776f726c642d6369746965732f762f756e737461626c65)](https://packagist.org/packages/pixxet/laravel-geoip-world-cities)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/pixxet/laravel-geoip-world-cities/blob/master/LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/e4aef416f5933dacc78a7f51f24b75d9b280c686913313f9953a75939784cba5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7069787865742f6c61726176656c2d67656f69702d776f726c642d6369746965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pixxet/laravel-geoip-world-cities)

Laravel GeoIP World Cities is package that provides [MaxMind](https://www.maxmind.com/en/free-world-cities-database) Free World Cities Database support for laravel applications.

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Before installing](#before-installing)
- [Installation](#installation)
- [Table structure](#table-structure)
- [Example](#example)
- [Troubleshooting](#troubleshooting)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

Introduction
------------

[](#introduction)

Includes city, region, country, latitude and longitude. This database doesn't contain any IP addresses. It's simply a listing of all the cities in the world.

This package simply loads the data provided in `worldcitiespop.txt.gz` file by [MaxMind](https://www.maxmind.com/) into a database and provides a `City` model to query the table.

Before installing
-----------------

[](#before-installing)

If you are looking for the Laravel 4 version, take a look [Branch 1.0](https://github.com/pixxet/laravel-geoip-world-cities/tree/1.0).

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

[](#installation)

**Note: This package is a bit large, ~40MB, installing and seeding the data could take a while.**

Add `pixxet/laravel-geoip-world-cities` to `composer.json`:

```
"pixxet/laravel-geoip-world-cities": "2.*"

```

for the last stable version, or

```
"pixxet/laravel-geoip-world-cities": "dev-master"

```

for the latest version.

Run `composer update` to pull down laravel-geoip-world-cities.

Edit `config/app.php` and add the `provider`

```
    'providers' => [
        Pixxet\LaravelGeoIPWorldCities\LaravelGeoIPWorldCitiesServiceProvider::class,
    ]
```

Optionally add the alias.

```
    'aliases' => [
        'Cities' => Pixxet\LaravelGeoIPWorldCities\Facade::class,
    ]
```

Configure MySQL and PDO, insert the following code in `config/database.php`:

```
    'mysql' => [
        'options'   => [PDO::MYSQL_ATTR_LOCAL_INFILE => true],
    ],
```

Publishing the configuration file, this is where you can change the default table name

```
php artisan vendor:publish

```

Publishing the migration and seeder files

```
php artisan cities:migration
php artisan cities:seeder

```

To make sure the data is seeded insert the following code in `seeds/DatabaseSeeder.php`

```
    // Seeding the cities
    $this->call(CitiesTableSeeder::class);
    $this->command->info('Seeded the cities table ...');
```

You may now run:

```
php artisan migrate --seed

```

After running this command the filled cities table will be available

Table structure
---------------

[](#table-structure)

idcountrycitycity\_asciiregionpopulationlatitudelongitude................2685662sdKhartoumkhartoum29197478015.58805632.534167................Example
-------

[](#example)

The package provides a `City` model which can be used to query the data

```
    \Pixxet\LaravelGeoIPWorldCities\City::whereCity('Khartoum')->first();
```

Troubleshooting
---------------

[](#troubleshooting)

If you are getting a `ReflectionException` when trying to seed

```
    [ReflectionException]
    Class CitiesTableSeeder does not exist
```

run:

```
    composer dump-autoload
```

and try again.

Change log
----------

[](#change-log)

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

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Credits
-------

[](#credits)

- [MaxMind](https://www.maxmind.com)
- [Khalid Pixxet](https://github.com/pixxet)
- [MCMatters](https://github.com/MCMatters)

License
-------

[](#license)

MaxMind WorldCities [License](http://download.maxmind.com/download/geoip/database/LICENSE_WC.txt).

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 97.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 ~59 days

Recently: every ~78 days

Total

7

Last Release

3350d ago

Major Versions

1.0 → 2.12016-05-03

1.1 → 2.22017-02-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/48be3e770dee61df7b7aadd1049cb7179de9041805a9fce958367d12e6ec9cc2?d=identicon)[pixxet](/maintainers/pixxet)

---

Top Contributors

[![kmuharam](https://avatars.githubusercontent.com/u/15950349?v=4)](https://github.com/kmuharam "kmuharam (86 commits)")[![omaratpxt](https://avatars.githubusercontent.com/u/3249754?v=4)](https://github.com/omaratpxt "omaratpxt (2 commits)")

---

Tags

laravelgeoipmaxmindlaravel-geoip-world-citiesworldcitiespopworld-citiesmaxmind-free-world-cities-databasepixxet

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/pixxet-laravel-geoip-world-cities/health.svg)

```
[![Health](https://phpackages.com/badges/pixxet-laravel-geoip-world-cities/health.svg)](https://phpackages.com/packages/pixxet-laravel-geoip-world-cities)
```

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[torann/geoip

Support for multiple Geographical Location services.

2.2k14.2M76](/packages/torann-geoip)[adrianorosa/laravel-geolocation

Laravel Geo Location package to get details for a given IP Address

6593.3k1](/packages/adrianorosa-laravel-geolocation)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[eseath/sypexgeo

A PHP package for working with the SypexGeo database file.

13176.3k](/packages/eseath-sypexgeo)

PHPackages © 2026

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