menarasolutions / geographer-laravel
Geographer integration classes for Laravel and Lumen
Installs: 92 400
Dependents: 3
Suggesters: 0
Security: 0
Stars: 20
Watchers: 3
Forks: 4
Open Issues: 0
Requires
- php: >=5.5.0
- menarasolutions/geographer: ^0.3.0
Requires (Dev)
- illuminate/support: 5.*
This package is auto-updated.
Last update: 2024-10-29 05:22:15 UTC
README
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