Installation
Using Composer
Installing the plugin via Composer is as straightforward as with any other CakePHP plugin. Run this in your project folder:
bash
composer require dereuromark/cakephp-geoDetails are on Packagist.
Load the plugin
bash
bin/cake plugin load GeoOptional packages
Depending on which tools you use (for example geocoding), you might need additional packages.
For using Google Maps as a concrete adapter, you might also need:
json
"geocoder-php/provider-implementation": "^1.0",
"geocoder-php/google-maps-provider": "^4.4.0",Alternative compatible packages can be found on Packagist.
TIP
Most providers need an API key to work. See the Geocoder behavior and Geocoder class pages for how to select and configure a provider.
Database setup
Some features — such as the GeocodedAddresses cache — rely on a database table. Set it up with the official migrations plugin for CakePHP:
bash
bin/cake migrations migrate -p GeoNext steps
- Geocoder behavior — geocode entity data on save.
- Map helpers — render maps in your views.
- GeocodedAddresses cache — cache geocoding API calls.