PHPackages                             grizzlygarillaz/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. [API Development](/categories/api)
4. /
5. grizzlygarillaz/geonames

ActiveLibrary[API Development](/categories/api)

grizzlygarillaz/geonames
========================

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

12.3(2mo ago)03MITPHPPHP ^8.0 || ^8.1 || ^8.2 || ^8.3 || ^8.4 || ^8.5

Since Feb 25Pushed 2mo agoCompare

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

READMEChangelog (1)Dependencies (13)Versions (2)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 michaeldrennen/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

```

To publish package files, run:

```
php artisan vendor:publish --provider="MichaelDrennen\Geonames\GeonamesServiceProvider"

```

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')`. You can change it in your `.env` file using `GEONAMES_UPDATE_DAILY_AT` key or in `config/geonames.php` file (if you have published it).

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

39

—

LowBetter than 86% of packages

Maintenance85

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.8% 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

Unknown

Total

1

Last Release

76d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c59de089f11fc43ae18cd5a4a81ae33dde53bb4dfbae98962c30a93a4a3a599?d=identicon)[grizzlygarillaz](/maintainers/grizzlygarillaz)

---

Top Contributors

[![michaeldrennen](https://avatars.githubusercontent.com/u/5288190?v=4)](https://github.com/michaeldrennen "michaeldrennen (266 commits)")[![grizzlygarillaz](https://avatars.githubusercontent.com/u/26850602?v=4)](https://github.com/grizzlygarillaz "grizzlygarillaz (10 commits)")[![leonid-chernyavskiy](https://avatars.githubusercontent.com/u/60206382?v=4)](https://github.com/leonid-chernyavskiy "leonid-chernyavskiy (7 commits)")[![karlshea](https://avatars.githubusercontent.com/u/40136?v=4)](https://github.com/karlshea "karlshea (4 commits)")[![simonschaufi](https://avatars.githubusercontent.com/u/941794?v=4)](https://github.com/simonschaufi "simonschaufi (2 commits)")[![victorlap](https://avatars.githubusercontent.com/u/1645632?v=4)](https://github.com/victorlap "victorlap (1 commits)")[![maherelgamil](https://avatars.githubusercontent.com/u/6294478?v=4)](https://github.com/maherelgamil "maherelgamil (1 commits)")[![mikrahub](https://avatars.githubusercontent.com/u/14978471?v=4)](https://github.com/mikrahub "mikrahub (1 commits)")[![0xAliRaza](https://avatars.githubusercontent.com/u/33368198?v=4)](https://github.com/0xAliRaza "0xAliRaza (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[michaeldrennen/geonames

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

9514.0k](/packages/michaeldrennen-geonames)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[masterro/laravel-mail-viewer

Easily view in browser outgoing emails.

6392.1k](/packages/masterro-laravel-mail-viewer)

PHPackages © 2026

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