1. Go to this page and download the library: Download navjobs/google-geocoder library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
navjobs / google-geocoder example snippets
// config/app.php
'providers' => [
// other providers
'ConstructionJobs\GoogleGeocoder\GoogleGeocoderServiceProvider'
];
// Geocode an address
$geocoder = new Geocoder;
$geocoder->geocode('New York, NY');
// Reverse geocode from coordinates
$geocoder = new Geocoder;
$geocoder->reverseByCoordinates(40.7127837, -74.0059413);
// Reverse geocode from a Google place id.
$geocoder = new Geocoder;
$geocoder->reverseByPlaceId('ChIJOwg_06VPwokRYv534QaPC8g');