---
title: "Place details — Google Places for Laravel | Roundly"
description: "Fetch a place by id — name, address, coordinates, types, opening hours and photos — with per-request field masks and helpers."
url: https://roundly-consulting.com/open-source/docs/google-places-for-laravel/place-details
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)

# Place details

details() returns a Place, or null when the place is not found:

```php
use RoundlyConsulting\GooglePlaces\DataTransferObjects\DetailsQuery;
use RoundlyConsulting\GooglePlaces\DataTransferObjects\Place;
use RoundlyConsulting\GooglePlaces\Facades\GooglePlaces;

$place = GooglePlaces::details($prediction->placeId); // or new DetailsQuery(...)

if ($place instanceof Place) {
    echo $place->name;
    echo $place->id;
    echo $place->formattedAddress;
    echo implode(', ', $place->types);

    echo $place->geometry?->location->latitude;
    echo $place->geometry?->location->longitude;

    foreach ($place->openingHours?->periods ?? [] as $period) {
        // from/to are "HHMM" strings; integer accessors are also available.
        echo "{$period->day}: {$period->from}–{$period->to}";
        echo "{$period->openHour}:{$period->openMinute}";
    }

    // Photo resource names — pass to photoUrl().
    foreach ($place->photos as $photoName) {
        $url = GooglePlaces::photoUrl($photoName, maxWidth: 800, maxHeight: 600);
    }

    $raw = $place->raw; // untouched Google payload
}
```

## Per-request field mask, language and refresh

Pass a DetailsQuery to override the configured field mask for one request, to ask for a localised response, or to skip the cache and refresh the cached entry with fresh (see Caching):

```php
// Override the field mask for this request only:
new DetailsQuery($placeId, fields: ['id', 'displayName', 'location', 'types', 'photos']);

// Localised response:
new DetailsQuery($placeId, language: 'sk');

// Skip the cache read and refresh the cached entry (see Caching):
new DetailsQuery($placeId, fresh: true);
```

## The Place object

| Property | Type | Contents |
| --- | --- | --- |
| `name` | `string` | Display name. |
| `id` | `?string` | Google place id. |
| `formattedAddress` | `?string` | Full formatted address. |
| `types` | `list<string>` | Place types. |
| `geometry` | `?Geometry` | location, viewportNorthEast, viewportSouthWest. |
| `openingHours` | `?OpeningHours` | isOpen and periods (day, from, to, openHour, openMinute, closeHour, closeMinute). |
| `photos` | `list<string>` | Photo resource names for photoUrl() / photo(). |
| `addressComponents` | `list<AddressComponent>` | Filled only when addressComponents is in the field mask. |
| `raw` | `array` | The untouched Google payload. |

Opening-hour periods expose from and to as “HHMM” strings plus integer openHour, openMinute, closeHour and closeMinute. day follows Google’s convention: 0 is Sunday.

## Place helpers

The Place DTO ships convenience accessors:

```php
$place->isOpenNow();           // bool
$place->coordinates();         // ?Location
$place->primaryType();         // ?string
$place->openingHoursFor(1);    // list<OpeningHourPeriod> for Monday (0 = Sunday)
$place->components();          // AddressComponents (needs addressComponents in the field mask)
```

primaryType() returns Google’s primaryType when the payload carries it and falls back to the first of the place’s types. The same Place object is returned by text search, nearby search and find place.

## 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)
