Query the Google Places API — place details, autocomplete, reverse geocoding, and distance matrix — from Laravel.
roundly-consulting/google-places-for-laravel is a Laravel package for query the google places api — place details, autocomplete, reverse geocoding, and distance matrix — from laravel..
It currently has 0 GitHub stars and 19 downloads on Packagist (latest version 1.2.1).
Install it with composer require roundly-consulting/google-places-for-laravel.
Discover more Laravel packages by roundly-consulting
or browse all Laravel packages to compare alternatives.
Last updated
Google's Places API (New), Routes API and Geocoding API from Laravel: autocomplete, place details, text and nearby search, geocoding, distances and photos through one typed client with fluent query objects, field masks, caching, rate limiting and a first-class fake for tests.
Requires PHP 8.4, Laravel 12 or 13, and a Google Maps Platform API key with the Places API (New), Routes API and Geocoding API enabled.
composer require roundly-consulting/google-places-for-laravel
Set GOOGLE_PLACES_API_KEY in .env; without it, calls throw PlacesException before any
request is sent.
Suggest places while the user types, then look up the chosen one:
use RoundlyConsulting\GooglePlaces\Facades\GooglePlaces;
$predictions = GooglePlaces::autocomplete('Luxury Restaurant'); // Collection<AutocompletePrediction>
$place = GooglePlaces::details($predictions->first()->placeId); // ?Place
$place->name;
$place->formattedAddress;
$place->coordinates(); // ?Location
$place->isOpenNow();
$photoUrl = GooglePlaces::photo($place->photos[0], maxWidth: 800)->url(); // key-free, safe for the browser
Search with filters and measure the trip:
use RoundlyConsulting\GooglePlaces\DataTransferObjects\{DistanceQuery, Location, TextSearchQuery};
use RoundlyConsulting\GooglePlaces\Enums\TravelMode;
$brunch = GooglePlaces::textSearch(
(new TextSearchQuery('vegan brunch'))->openNow()->withMinRating(4.0)->take(10),
); // Collection<Place>
$trip = GooglePlaces::distance(new DistanceQuery(
from: new Location(48.1486, 17.1077), // Bratislava
to: new Location(48.2082, 16.3738), // Vienna
type: TravelMode::Driving,
));
$trip->humanReadableDistance; // "79.8 km"
$trip->humanReadableDuration; // "1h 5m"
The full documentation — configuration, every feature and its API, and testing — lives on our website: roundly-consulting.com/open-source/docs/google-places-for-laravel
Release notes are in CHANGELOG.md. To contribute, see the contributing guide.
This package is free and open source, built and maintained by Roundly Consulting. If it saves you time, please consider supporting our open-source work — a one-time donation, a monthly pledge on Patreon or a crypto donation helps fund maintenance, new features and new packages.
The MIT License (MIT). Please see License File for more information.