New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

brocard/geolocation

Set a geolocation tables for any projects
88 1
Install
composer require brocard/geolocation
Latest Version:v0.4
PHP:>=5.6.4
License:MIT
Last Updated:Jul 7, 2017
Links: GitHub  ·  Packagist
Maintainer: brocard

Library to fetch data from geonames.org

Latest Version on Packagist GitHub license Total Downloads StyleCI

Add the Geoname service provider to the config/app.php file in the providers array:

'providers' => [
    // Laravel Framework Service Providers...
    //...

    // Package Service Providers
    BrocardJr\Geo\GeoServiceProvider::class,
    // ...

    // Application Service Providers
    // ...
],

For first instance you only need set enviroment variable intro .env file in root directoy

example:  GEONAMES_USERNAME=your_username

You may easily access your configuration values using the global config helper function only run the next artisan command

php artisan vendor:publish --provider="BrocardJr\Geo\GeoServiceProvider"

Reload de config for some changes

php artisan vendor:publish --provider="BrocardJr\Geo\GeoServiceProvider" --tag=config --force

Install migrations

php artisan geo:install

Get countries from api.geonames.org

php artisan geo:import-countries

Get states from api.geonames.org

php artisan geo:import-states

Related Packages

laragear/meta

A Laravel Package helper for Laravel Packages

1,346,523 7
cleaniquecoders/laravel-helper

Built with Laravel Standalone Package Creator

10,396 4
ipunkt/laravel-package-manager

Package Manager for laravel packages

1,744 2
wi-development/media

Admin's media

50 0
wi-development/locale

Admin's locale

49 0

Version History

Version Released PHP License
v0.4 >=5.6.4 MIT
v0.3 >=5.6.4 MIT