Skip to content

stefnats/laravel-google-distance

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Distance in Laravel

StyleCI

Requirements

  • PHP >= 7.1.3
  • Laravel >= 5.5.*

Installation

Require this package with composer.

composer require pnlinh/laravel-google-distance

To publishes config config/distance.php, use command:

php artisan vendor:publish --tag="distance-config"

You must set your Google Maps API Key GOOGLE_MAPS_DISTANCE_API_KEY in your .env file like so:

GOOGLE_MAPS_DISTANCE_API_KEY=ThisIsMyGoogleApiKey

Usage

// Use Facades
use Pnlinh\GoogleDistance\Facades\GoogleDistance;

$distance = GoogleDistance::calculate('FromAddress', 'To Address');

// Use Helper Function
$distance = google_distance('From Address', 'To Address');

Credits

For more info, please visit https://developers.google.com/maps/documentation/distance-matrix/

About

Caculate Google Distance Matrix API in Laravel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%