2017 © Pedro Peláez
 

library laravel-geoip-world-cities

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

image

pixxet/laravel-geoip-world-cities

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

  • Saturday, March 11, 2017
  • by pixxet
  • Repository
  • 1 Watchers
  • 0 Stars
  • 117 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

laravel-geoip-world-cities (Laravel 5)

Latest Version on Packagist Latest Unstable Version ![Software License][ico-license] Total Downloads, (*1)

Laravel GeoIP World Cities is package that provides MaxMind Free World Cities Database support for laravel applications., (*2)

Contents

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., (*3)

This package simply loads the data provided in worldcitiespop.txt.gz file by MaxMind into a database and provides a City model to query the table., (*4)

Before installing

If you are looking for the Laravel 4 version, take a look Branch 1.0., (*5)

Installation

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

Add pixxet/laravel-geoip-world-cities to composer.json:, (*7)

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

for the last stable version, or, (*8)

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

for the latest version., (*9)

Run composer update to pull down laravel-geoip-world-cities., (*10)

Edit config/app.php and add the provider, (*11)

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

Optionally add the alias., (*12)

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

Configure MySQL and PDO, insert the following code in config/database.php:, (*13)

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

Publishing the configuration file, this is where you can change the default table name, (*14)

php artisan vendor:publish

Publishing the migration and seeder files, (*15)

php artisan cities:migration
php artisan cities:seeder

To make sure the data is seeded insert the following code in seeds/DatabaseSeeder.php, (*16)

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

You may now run:, (*17)

php artisan migrate --seed

After running this command the filled cities table will be available, (*18)

Table structure

id country city city_ascii region population latitude longitude
.. .. .. .. .. .. .. ..
2685662 sd Khartoum khartoum 29 1974780 15.588056 32.534167
.. .. .. .. .. .. .. ..

Example

The package provides a City model which can be used to query the data, (*19)

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

Troubleshooting

If you are getting a ReflectionException when trying to seed, (*20)

    [ReflectionException]                   
    Class CitiesTableSeeder does not exist 

run:, (*21)

    composer dump-autoload

and try again., (*22)

Change log

Please see CHANGELOG for more information on what has changed recently., (*23)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*24)

Credits

License

MaxMind WorldCities License., (*25)

The MIT License (MIT). Please see License File for more information., (*26)

The Versions

11/03 2017

dev-master

9999999-dev https://github.com/pixxet/laravel-geoip-world-cities

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel geoip maxmind world-cities laravel-geoip-world-cities worldcitiespop maxmind-free-world-cities-database pixxet

11/03 2017

2.3.1

2.3.1.0 https://github.com/pixxet/laravel-geoip-world-cities

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel geoip maxmind world-cities laravel-geoip-world-cities worldcitiespop maxmind-free-world-cities-database pixxet

11/02 2017

2.3

2.3.0.0 https://github.com/moharrum/laravel-geoip-world-cities

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel geoip maxmind world-cities moharrum laravel-geoip-world-cities worldcitiespop maxmind-free-world-cities-database

11/02 2017

2.2

2.2.0.0 https://github.com/moharrum/laravel-geoip-world-cities

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel geoip maxmind world-cities moharrum laravel-geoip-world-cities worldcitiespop maxmind-free-world-cities-database

04/05 2016

dev-laravel-4

dev-laravel-4 https://github.com/moharrum/laravel-geoip-world-cities

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel geoip maxmind world-cities moharrum laravel-geoip-world-cities worldcitiespop maxmind-free-world-cities-database

04/05 2016

1.1

1.1.0.0 https://github.com/moharrum/laravel-geoip-world-cities

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel geoip maxmind world-cities moharrum laravel-geoip-world-cities worldcitiespop maxmind-free-world-cities-database

03/05 2016

2.1

2.1.0.0 https://github.com/moharrum/laravel-geoip-world-cities

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel geoip maxmind world-cities moharrum laravel-geoip-world-cities worldcitiespop maxmind-free-world-cities-database

19/03 2016

1.0

1.0.0.0 https://github.com/moharrum/laravel-geoip-world-cities

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel geoip maxmind world-cities moharrum laravel-geoip-world-cities worldcitiespop maxmind-free-world-cities-database

19/03 2016

2.0

2.0.0.0 https://github.com/moharrum/laravel-geoip-world-cities

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel geoip maxmind world-cities moharrum laravel-geoip-world-cities worldcitiespop maxmind-free-world-cities-database