flarone / google-matrix-api
Wrapper for the Google Distance Matrix API (and Laravel friendly)
1.0.4
2023-03-18 20:41 UTC
Requires
- php: ^7.2|^7.3|^8.0|^8.1|^8.2
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- mockery/mockery: ^1.0
- orchestra/testbench: ^4.0
- phpunit/phpunit: ^8.0|^9.3.3
README
Requirements
- PHP >= 7.1.3, >= 8.0.*, >= 8.1.*, >= 8.2.*
- Laravel >= 5.5.*, 6.*, 7.*, 8.*, 9.*, 10.*
Installation
Require this package with composer.
composer require flarone/google-matrix-api
To publishes config config/google-matrix-api.php
, use command:
php artisan vendor:publish --tag="google-matrix"
You must set your Google Maps API Key GOOGLE_MAPS_MATRIX_API_KEY in your .env file like so:
GOOGLE_MAPS_MATRIX_API_KEY=ThisIsMyGoogleApiKey
Usage
// Use Facades use Flarone\GoogleMatrix\Facades\GoogleMatrix; $matrix = GoogleMatrix::calculate('FromAddress', 'To Address'); // Use Helper Function $matrix = google_matrix('From Address', 'To Address');
Test
composer test
Credits
For more info, please visit https://developers.google.com/maps/documentation/distance-matrix/