PHP code example of alignwebs / laravel-google-places-autocomplete

1. Go to this page and download the library: Download alignwebs/laravel-google-places-autocomplete 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/ */

    

alignwebs / laravel-google-places-autocomplete example snippets



use Alignwebs\LaravelGooglePlacesAutocomplete\Services\GooglePlacesAutocomplete;

$google_places_autocomplete = new GooglePlacesAutocomplete('API_KEY');

$google_places_autocomplete->setLocation(27.8880047, 81.9632554); // Optional
$google_places_autocomplete->setRadius(5000); // Optional

$result = $google_places_autocomplete->search("new street");