PHP code example of salmanzafar / laravel-geocode

1. Go to this page and download the library: Download salmanzafar/laravel-geocode 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/ */

    

salmanzafar / laravel-geocode example snippets


use Salman\GeoCode\Services\GeoCode;

public function lookForPoints()
{
        $address = "1600 Amphitheatre Parkway,Mountain View";
        $getPoints = new GeoCode();
        return $getPoints->getLatAndLong($address); 
}

use GeoCode;

public function lookForPoints()
{
    $address = "1600 Amphitheatre Parkway,Mountain View";
    return GeoCode::getLatAndLong($address); 
}

public function lookForPoints()
{
    $address = "1600 Amphitheatre Parkway,Mountain View";
    return findAddressCoordinates($address); 
}
bash
php artisan vendor:publish --provider="Salman\GeoCode\GeoCodeServiceProvider"