---
title: "Google Places for Laravel — docs | Roundly"
description: "Developer docs for Google Places for Laravel: autocomplete, place details, search, geocoding, distance matrix, photos, caching, rate limits and testing."
url: https://roundly-consulting.com/open-source/docs/google-places-for-laravel
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

Open source

# Google Places for Laravel

Install

`composer require roundly-consulting/google-places-for-laravel`

Requires: PHP ^8.4 · Laravel ^12.0|^13.0

[GitHub](https://github.com/roundly-consulting/google-places-for-laravel) [Packagist](https://packagist.org/packages/roundly-consulting/google-places-for-laravel) [Donate (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Patreon](https://www.patreon.com/cw/roundly)

## Overview

A typed Laravel client for Google’s Places API (New), Routes API and Geocoding API. Autocomplete addresses, look up and search places, geocode in both directions, compute travel distances, times and full matrices, and fetch place photos — all through one facade that returns clean data objects instead of raw JSON. Built on Laravel’s own HTTP client with no Google SDK, MIT-licensed, and its only other dependencies are four small Roundly packages. A first-class GooglePlaces::fake() keeps your test suite off the paid API.

### What you get

#### Places API (New)

Autocomplete, place details, text and nearby search and find place on Google’s current-generation Places API — header auth and field masks included.

#### Geocoding both ways

Reverse-geocode coordinates or forward-geocode addresses, then read street, city, postcode and country through typed accessors.

#### Distance, ETA & matrix

Traffic-aware distance and travel time on the Routes API, one trip per destination from a single origin, and full origins × destinations matrices.

#### Key-safe photos

Fetch place photo bytes, save them to any Laravel disk, or hand the browser a key-free media URL.

#### Cost-aware & resilient

Trimmable field masks, billing sessions, opt-in caching, a pagination cap, per-API rate limiting, timeouts and connection retries.

#### Facade or injected client

Call GooglePlaces::… or inject the PlacesClient contract — GooglePlaces::fake() records every call from either, with no paid traffic.

#### Observable

Lifecycle events for every request, opt-in request logging, and a health check as code or a preflight command.

### Documentation

#### [Installation](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/installation.md)

Install via Composer, add your Google API key, optionally publish the config and verify the setup with one command.

#### [Configuration](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/configuration.md)

Every config key and env variable — API key, hosts, field masks, timeouts, caching, pagination, logging and per-API rate limits.

#### [The GooglePlaces facade](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/client.md)

Every lookup, handle and health check on one facade — scalar shorthands or immutable query objects, and GooglePlaces::fake() for tests.

#### [Without the facade](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/without-facade.md)

Inject the PlacesClient contract for the same API without static calls — google-places has no action classes; the client methods are the use cases.

#### [Autocomplete](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/autocomplete.md)

Place predictions as the user types — types, regions, location bias or restriction, and billing sessions that cut autocomplete costs.

#### [Place details](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/place-details.md)

Fetch a place by id — name, address, coordinates, types, opening hours and photos — with per-request field masks and helpers.

#### [Search & find place](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/search.md)

Text search, nearby search and find place — with filters, location bias, page tokens and lazy auto-pagination under a safety cap.

#### [Geocoding](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/geocoding.md)

Reverse-geocode coordinates, forward-geocode addresses, and read street, city, postcode and country through typed accessors.

#### [Distance & travel time](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/distance.md)

Distance and ETA on the Routes API — four travel modes, traffic-aware driving, and one trip per destination from a single origin.

#### [Distance matrix](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/distance-matrix.md)

Compute many origins against many destinations in one call and index every pair, row or column of the result.

#### [Photos](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/photos.md)

Build photo media URLs, or fetch photo bytes server-side, save them to any disk and get a key-free URL for the browser.

#### [Error handling](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/error-handling.md)

One PlacesException with typed checks for rate limits, denied keys, invalid requests and unreachable APIs — the key is redacted from every message.

#### [Caching](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/caching.md)

Opt-in caching of idempotent lookups to cut latency and Google spend — safe keys, remembered not-founds and a fresh flag to refresh on demand.

#### [Events & logging](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/events-logging.md)

One lifecycle event per request sent to Google and opt-in request logging — for metrics, alerting and audits, without ever exposing the key.

#### [Rate limiting](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/rate-limiting.md)

Every outbound call is paced per Google API on its own budget — adaptive to 429s, tunable by env, with an opt-in fail-fast mode.

#### [Validation rules](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/validation-rules.md)

Drop-in Laravel rules that check a place id or a latitude/longitude pair is well-formed before you call Google — messages in English and Slovak.

#### [Geolocation driver](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/geolocation-driver.md)

Use Google Places as a google\_places driver in geolocation-for-laravel for address and coordinate lookups — failures fall through, never abort.

#### [Artisan commands](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/commands.md)

A preflight check that probes each Google API with your key — as a command or GooglePlaces::check() — plus a section in php artisan about.

#### [Testing](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/testing.md)

GooglePlaces::fake() records every call and answers from seeded results — assert what your code asked Google, with no paid API traffic.

#### [Requirements](https://roundly-consulting.com/open-source/docs/google-places-for-laravel/requirements.md)

PHP 8.4+, Laravel 12 or 13, and a Google Maps Platform key with the Places, Routes and Geocoding APIs enabled.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source.md)
