netbrothers-gmbh / nb-googleapi-bundle
SymfonyBundle for calling GoogleMaps
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.2
- ext-json: *
- ramsey/uuid: *
- symfony/console: *
- symfony/http-client: *
- symfony/serializer: *
- symfony/string: *
- symfony/yaml: *
This package is auto-updated.
Last update: 2024-11-23 13:04:22 UTC
README
This small library for Symfony sends requests to the GoogleMaps Places autocomplete.
Installation
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Applications that use Symfony Flex
Open a command console, enter your project directory and execute:
composer require netbrothers-gmbh/nb-google-api
Applications that don't use Symfony Flex
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
composer require netbrothers-gmbh/nbcsb-bundle
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php
file of your project:
// config/bundles.php return [ // ... NetBrothers\NbGoogleApiBundle\NbGoogleApiBundle::class => ['all' => true], ];
Configuration
- Copy
install/config/packages/netbrothers_google_api.yaml
to symfony's config path - Add required values to your
.env
(have a look into install/env.default):
###> netbrothers-gmbh/netbrothers_google_api ###
NB_GOOGLE_API_ENABLE=1
NB_GOOGLE_API_PLACES_AUTOCOMPLETE_URI=https://maps.googleapis.com/maps/api/place/autocomplete/
NB_GOOGLE_API_PLACES_AUTOCOMPLETE_REQUEST_TYPE=json
NB_GOOGLE_PLACES_AUTOCOMPLETE_API_KEY=YOUR_API_KEY
###< netbrothers-gmbh/netbrothers_google_api ###
- Clear symfony's cache.
Usage
For a first view just run the example command bin/console netbrothers:example:google-autocomplete
.
Also have a look into example/ExampleController.php
Author
Stefan Wessel, NetBrothers GmbH
Licence
MIT