Skip to content

Some update documentation #65

Closed
Closed
@philippejadin

Description

@philippejadin

For those that used the previous version it might not be clear how it works now. Could you add this to the readme? Sorry if it's not very clear, at least it's a start.

  • change your composer.json, use this : "toin0u/geocoder-laravel": "^1.0",
  • edit/redo your config/geocoder.php (take the config file https://github.com/geocoder-php/GeocoderLaravel/blob/master/config/geocoder.php as inspiration
  • change your config/app.php to Geocoder\Laravel\Providers\GeocoderService::class,
  • change your "use" statement everywhere it's needed to : use Geocoder\Laravel\Facades\Geocoder;

Now if you want to goecode some address and get the latitude for instance, use this :

$latitude = Geocoder::geocode('Brussels, Belgium')->get()->first()->getLatitude();

A geocoder object is returned, so you can use all the methods documented here : https://github.com/geocoder-php/Geocoder#usage

hth

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions