---
title: "Geolocation driver — Google Places for Laravel | Roundly"
description: "Use Google Places as a google_places driver in geolocation-for-laravel for address and coordinate lookups — failures fall through, never abort."
url: https://roundly-consulting.com/open-source/docs/google-places-for-laravel/geolocation-driver
language: en
---

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

[Google Places for Laravel](https://roundly-consulting.com/open-source/docs/google-places-for-laravel.md)

# Geolocation driver

The package registers a google\_places driver on the geolocation-for-laravel manager. It forward-geocodes addresses and reverse-geocodes coordinates through Google Places, mapping the result onto geolocation’s own Location DTO. Google Places has no IP geolocation, so IP-only lookups fall through to the next provider.

## It never aborts the pipeline

- An unreachable Google — timeout, DNS failure, refused connection — is reported as geolocation’s ProviderUnavailableException, which the manager records on LocationResolutionFailed and skips.
- Every other Places failure — no key configured, REQUEST\_DENIED, OVER\_QUERY\_LIMIT, a client-side rate-limit fail-fast — is a miss (null), so the next provider answers. The PlacesRequestFailed event still fires for an API error.
- The driver reads google-places’ own config (GOOGLE\_PLACES\_API\_KEY, timeouts, rate limits). geolocation’s per-call overrides — withToken('google\_places', …), withConfig(), withTimeout() — do not reach it.

## Using the driver

Opt the driver into your geolocation pipeline:

```php
// config/geolocation.php — consult google_places in your resolution order:
'pipeline' => ['maxmind_database', 'google_places', 'default'],
```

Or call it ad-hoc:

```php
use RoundlyConsulting\Geolocation\DataTransferObjects\Coordinates;
use RoundlyConsulting\Geolocation\Facades\Geolocation;

// Ad-hoc, scoped to the driver for a single call:
$location = Geolocation::provider('google_places')->locateAddress('Bratislava, Slovakia');
$location = Geolocation::provider('google_places')->locateCoordinates(new Coordinates(48.1486, 17.1077));

echo $location?->humanReadable;
echo $location?->countryIsoCode;
```

The mapped Location fills humanReadable, street (number plus route), city, region, postalCode, countryIsoCode, latitude and longitude from the first geocoding result. The lookups run through the same client, so caching, rate limits and events apply.

## 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/docs/google-places-for-laravel.md)
