PHP code example of nomala / statamic-google-places

1. Go to this page and download the library: Download nomala/statamic-google-places library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nomala / statamic-google-places example snippets


{{ place:find input="paris" input_type="textquery" parameters="language=fr" }}
    {{ place_id }}
{{ /place:find }}

{{ place:nearby lat="40.6971494" lng="-74.2598655" radius="10000" parameters="type=doctor&rankby=distance" }}
    {{ name }}, {{ place_id }} <br>
{{ /place:nearby }}

{{ place:details place_id="ChIJYeZuBI9YwokRjMDs_IEyCwo" parameters="fields=formatted_address,name,geometry&language=fr" }}
    {{ name }} <br>
    {{ geometry.location.lat }} <br>
    {{ geometry.location.lng }} <br>
    {{ formatted_address }}
{{ /place:details }}

{{ place:find input="paris" }}
    {{ place:details place_id="{ place_id }" }}
        {{ name }} <br>
        {{ formatted_address }}
    {{ /place:details }}
{{ /place:find }}

{{ place:photos input="Manhattan" }}
    {{ photo }} <br>,
    <img src="{{ photoUrl }}" /> <br>
{{ /place:photos }}

{{ place:photos input="Manhattan" }}
    {{ dump }}
{{ /place:photos }}
bash
php artisan vendor:publish --provider="Nomala\StatamicGooglePlaces\StatamicGooglePlacesServiceProvider"