MenaraSolutions / geographer-laravel by dusterio

Geographer integration classes for Laravel and Lumen
92,460
20
3
Package Data
Maintainer Username: dusterio
Maintainer Contact: denis@menara.com.au (Denis Mysenko)
Package Create Date: 2016-07-10
Package Last Update: 2018-10-04
Language: PHP
License: MIT
Last Refreshed: 2024-11-11 15:12:58
Package Statistics
Total Downloads: 92,460
Monthly Downloads: 1,237
Daily Downloads: 22
Total Stars: 20
Total Watchers: 3
Total Forks: 4
Total Open Issues: 0

geographer-laravel

Laravel (and Lumen) integration for Geographer

Getting started

Install Laravel integration package first:

$ composer require menarasolutions/geographer-laravel

Good news is that Laravel will take care of singleton instance for you, so no matter how many times you call it – it's the same object.

In Laravel 5.5, service providers and aliases are automatically registered. If you're using Laravel 5.5, skip ahead.

// Add in your config/app.php

'providers' => [
    '...',
    MenaraSolutions\Geographer\Integrations\LaravelServiceProvider::class,
];

'aliases' => [
    '...',
    'Geographer' => MenaraSolutions\Geographer\Integrations\LaravelFacade::class,
];

// Start playing with it, all the same calls
Geographer::getCountries()->useShortNames()->toArray();

Full list of methods is available in Geographer documentation