geocode

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

PHP Address Geocoding for laravel using Google API

Install

composer require sapio/geocode

Include Sapio\Geocode\GeocodeServiceProvider::class, in your config/app.php

Usage

use Sapio\Geocode\GeoCode as Geocode;

Route::get('/', function () {

    $address = '1600 Wigwam Pkwy, Henderson, NV 89074';

    $geocode = Geocode::getCoordinates($address);

    return view('welcome')->with(['geocode' => $geocode]);
});

Pull Latitude: $geocode['lat'] Pull Longitude: $geocode['lng']