PHPackages                             dev-zoren/geonames - 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. dev-zoren/geonames

ActiveLibrary

dev-zoren/geonames
==================

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

01PHP

Since Dec 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dev-zoren/geonames)[ Packagist](https://packagist.org/packages/dev-zoren/geonames)[ RSS](/packages/dev-zoren-geonames/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

geonames v7.x
=============

[](#geonames-v7x)

[![Latest Stable Version](https://camo.githubusercontent.com/17a502025a24139e58284a0c4d543b2631281d854afc14f81ab8939a36fa68c9/68747470733a2f2f706f7365722e707567782e6f72672f6d69636861656c6472656e6e656e2f67656f6e616d65732f76657273696f6e)](https://packagist.org/packages/michaeldrennen/geonames) [![Total Downloads](https://camo.githubusercontent.com/0aadf1cadca39956f5c377050e92fdaef6f87c6d07ec89afb753c919b7de42fd/68747470733a2f2f706f7365722e707567782e6f72672f6d69636861656c6472656e6e656e2f67656f6e616d65732f646f776e6c6f616473)](https://packagist.org/packages/michaeldrennen/geonames) [![License](https://camo.githubusercontent.com/51b8fe10daa5455cd26e6e7fdf3482cf0b63fce87d8e2ef17ed627170e79c69b/68747470733a2f2f706f7365722e707567782e6f72672f6d69636861656c6472656e6e656e2f67656f6e616d65732f6c6963656e7365)](https://packagist.org/packages/michaeldrennen/geonames) [![GitHub issues](https://camo.githubusercontent.com/9a07c3326db99885c03e0cc6bb40de51dd286a551d6a0e266a01f399a6b37be6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6d69636861656c6472656e6e656e2f47656f6e616d6573)](https://github.com/michaeldrennen/Geonames/issues) [![GitHub forks](https://camo.githubusercontent.com/669928e4a2307a4c771978324f0c405adce15a8870c1b7126bd87de3d1f71ed3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6d69636861656c6472656e6e656e2f47656f6e616d6573)](https://github.com/michaeldrennen/Geonames/network) [![GitHub stars](https://camo.githubusercontent.com/24669536834a8eadb84937dc9006f16076149b63ea72efc241ea5039226d4ca8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6d69636861656c6472656e6e656e2f47656f6e616d6573)](https://github.com/michaeldrennen/Geonames/stargazers) [![Travis (.org)](https://camo.githubusercontent.com/b7a039076ab3def5ee649db6415ca2e87885186f2fb942a000491af08ab59433/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d69636861656c6472656e6e656e2f47656f6e616d6573)](https://camo.githubusercontent.com/b7a039076ab3def5ee649db6415ca2e87885186f2fb942a000491af08ab59433/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d69636861656c6472656e6e656e2f47656f6e616d6573)

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

Major Version Jump
------------------

[](#major-version-jump)

I jumped several major versions to catch up with Larvel's major version number. Makes things a little clearer.

Notes
-----

[](#notes)

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.

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

[](#installation)

```
composer require dev-zoren/geonames

```

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

```
MichaelDrennen\Geonames\GeonamesServiceProvider::class,
```

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
```

Maintenance
-----------

[](#maintenance)

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:

```
$schedule->command('geonames:update')->dailyAt('3:00');
```

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

By default, `GeonamesServiceProvider` will run it for you daily at `config('geonames.update_daily_at')`.

Gotchas
-------

[](#gotchas)

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

@see

Add this to your AppServiceProvider.php file:

```
Schema::defaultStringLength(191);
```

A quick word on indexes
-----------------------

[](#a-quick-word-on-indexes)

This library contains a bunch of migrations that contain a bunch of indexes. Now not everyone will need all of the indexes.

So when you install this library, run the migrations and delete the indexes that you don't need.

Also, Laravel doesn't let you specify a key length for indexes on varchar columns. There are two indexes suffering from this limit. Instead of creating indexes on those columns the "Laravel way", I send a raw/manual query to create the indexes with the proper lengths.

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a2e79273491dc802d30479f5fdd1cdcd2aec94a637fc61a851493e886410e88d?d=identicon)[dev-zoren](/maintainers/dev-zoren)

---

Top Contributors

[![dev-zoren](https://avatars.githubusercontent.com/u/114976515?v=4)](https://github.com/dev-zoren "dev-zoren (3 commits)")

### Embed Badge

![Health badge](/badges/dev-zoren-geonames/health.svg)

```
[![Health](https://phpackages.com/badges/dev-zoren-geonames/health.svg)](https://phpackages.com/packages/dev-zoren-geonames)
```

PHPackages © 2026

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