- PHP >= 7.1.3
- Laravel >= 5.5
This package is the continuation of
GeneaLabs/Phpgmaps. The move to the more appropriately-named package namespace is in preparation for a complete rewrite of the package, optimizing it for Laravel.
This repo aims to keep appitventures/phpgmaps alive, hopefully filling in temporarily until they make their repo available again, or else continuing its maintenance going forward and keeping it working with future versions of Laravel.
Currently only Laravel 5.* is supported.
Add the repo to composer.json under this new namespace:
composer require genealabs/laravel-maps
Add an environment variable with your Google Maps API Key in your
Lastly, add the following entry to your
\config\services.php config file:
'google' => [ 'maps' => [ 'api-key' => env('GOOGLE_MAPS_API_KEY'), ], ],
The following code will prompt the user for access to their geolocation and then creates a map centered on their lat/lng
BIOINSTALL has a great website showing how to do all the things with the class. No reason to reinvent the wheel, so here it is. The only thing to note is that
$this->googlemaps is now either the facade
Map:: or the app variable