Skip to content
A Laravel (php) package to interface with the geo-location services at
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Added some comments to the update script. May 29, 2019
tests Debugging. May 28, 2019
.gitignore Moving to codecov May 20, 2019
.travis.yml Debugging. May 28, 2019
LICENSE Initial commit Feb 8, 2017 Reverting alternate index syntax. May 26, 2019
_config.yml Set theme jekyll-theme-cayman Apr 4, 2017
composer.json Adding more tests. May 26, 2019
phpunit.xml Debugging. May 28, 2019
scratch.php Updated a few files related to the phpunit tests. May 12, 2019

geonames v2.x

Latest Stable Version Total Downloads License

A Laravel (php) package to interface with the geo-location services at


There is still a lot that needs to be done to make this package "complete". I've gotten it to a point where I can use it for my next project. As time allows, I will improve the documentation and testing that comes with this package. Thanks for understanding.


composer require michaeldrennen/geonames

And then add geonames provider to providers array in app.php config file:


After that, Run migrate command:

php artisan migrate

Want to install all of the geonames records for the US, Canada, and Mexico as well as pull in the feature codes definitions file in English?

php artisan geonames:install --country=US --country=CA --country=MX --language=en

Want to just install everything in the geonames database?

php artisan geonames:install


Now that you have the geonames database up and running on your system, you need to keep it up-to-date.

I have an update script that you need to schedule in Laravel to run every day.

Some info on how to schedule Laravel artisan commands:

You can read this notice at:

The "last modified" timestamp is in Central European Time.

It looks like geonames updates their data around 3AM CET.

So if you schedule your system to run the geonames:update artisan command after 4AM CET, you should be good to go.

I like to keep my servers running on GMT. Keeps things consistent.

(Central European Time is 1 hour ahead of Greenwich Mean Time)

Assuming your servers are running on GMT, your update command would look like:


The update artisan command will handle the updates and deletes to the geonames table.


Are you getting something like: 1071 Specified key was too long


Add this to your AppServiceProvider.php file:

You can’t perform that action at this time.