PHPackages                             illuma-law/laravel-places-scout - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. illuma-law/laravel-places-scout

ActiveLibrary[Search &amp; Filtering](/categories/search)

illuma-law/laravel-places-scout
===============================

A fluent Laravel package for interacting with the Google Places API with strongly typed DTOs.

v0.1.4(1mo ago)062MITPHPPHP ^8.3CI passing

Since Apr 20Pushed 1mo agoCompare

[ Source](https://github.com/illuma-law/laravel-places-scout)[ Packagist](https://packagist.org/packages/illuma-law/laravel-places-scout)[ Docs](https://github.com/illuma-law/laravel-places-scout)[ RSS](/packages/illuma-law-laravel-places-scout/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (16)Versions (6)Used By (0)

Laravel Places Scout
====================

[](#laravel-places-scout)

[![Latest Version on Packagist](https://camo.githubusercontent.com/61c029d2bfc9bb9045eda201bbcf2a5c0257e5237787bb43a53730e74699e2ec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696c6c756d612d6c61772f6c61726176656c2d706c616365732d73636f75742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/illuma-law/laravel-places-scout)[![GitHub Tests Action Status](https://camo.githubusercontent.com/78801b4bec19576ad4376924243a929be7f8262485f7c9facf3730281d2510e3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f696c6c756d612d6c61772f6c61726176656c2d706c616365732d73636f75742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/illuma-law/laravel-places-scout/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub PHPStan Action Status](https://camo.githubusercontent.com/ddccc8a3cda1e2de4304fdc682c3cfe55844c50d00df4b7ac8682ca7a4d67fc5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f696c6c756d612d6c61772f6c61726176656c2d706c616365732d73636f75742f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d7068707374616e267374796c653d666c61742d737175617265)](https://github.com/illuma-law/laravel-places-scout/actions?query=workflow%3Aphpstan+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/373cca635181caa7d3411bf80003c633c69bf99f4120598096e58284fb2a74c8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696c6c756d612d6c61772f6c61726176656c2d706c616365732d73636f75742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/illuma-law/laravel-places-scout)

A fluent Laravel package for interacting with the Google Places API using strictly typed DTOs.

Places Scout acts as a dedicated abstraction over the Google Maps Places API. Instead of dealing directly with raw HTTP requests and unstructured JSON arrays, this package provides an elegant, object-oriented API that maps Google's responses directly into fully typed PHP 8.3 Data Transfer Objects (DTOs) with IDE autocompletion out of the box.

Features
--------

[](#features)

- **Text Search**: Search for places using natural text queries with automatic pagination support.
- **Place Details**: Retrieve highly detailed information (phone, website, coordinates) about specific places using their Place ID.
- **Strongly Typed DTOs**: Immutable, `readonly` data transfer objects ensure data integrity.
- **Fluent Interface**: Clean, chainable API via Facade or Dependency Injection.
- **Multi-Tenant Friendly**: Supports overriding API keys on the fly.
- **Graceful Error Handling**: Suppresses exceptions on failed API requests (logging them instead) and returns `null`, preventing your application from crashing due to third-party API instability.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require illuma-law/laravel-places-scout
```

Publish the configuration file:

```
php artisan vendor:publish --tag="places-scout-config"
```

Configuration
-------------

[](#configuration)

Add your Google Places API key to your `.env` file:

```
GOOGLE_PLACES_API_KEY=your_api_key_here
```

The published `config/places-scout.php` will use this key automatically:

```
return [
    /**
     * Your Google Places API Key.
     * Obtain an API key from the Google Cloud Console:
     * https://console.cloud.google.com/google/maps-apis/credentials
     */
    'api_key' => env('GOOGLE_PLACES_API_KEY'),
];
```

Usage &amp; Integration
-----------------------

[](#usage--integration)

### Text Search

[](#text-search)

Search for places using a text query. It returns a `PlaceSearchResponse` DTO containing an array of `PlaceSearchResult` DTOs.

```
use IllumaLaw\PlacesScout\Facades\PlacesScout;

// Basic text search
$response = PlacesScout::textSearch('Law firms in New York');

if ($response) {
    foreach ($response->results as $result) {
        echo $result->name;             // 'Smith & Associates'
        echo $result->placeId;          // 'ChIJ...'
        echo $result->formattedAddress; // '123 Main St, New York, NY'
        echo $result->latitude;         // 40.7128
        echo $result->longitude;        // -74.0060
        echo $result->rating;           // 4.8
    }

    // Handle pagination using the nextPageToken
    if ($response->nextPageToken) {
        $nextPage = PlacesScout::textSearch('Law firms in New York', $response->nextPageToken);
    }
}
```

### Place Details

[](#place-details)

Get detailed information about a specific place using its `place_id`. Returns a `PlaceDetails` DTO.

```
use IllumaLaw\PlacesScout\Facades\PlacesScout;

$details = PlacesScout::getPlaceDetails('ChIJN1t_tDeuEmsRUsoyG83frY4');

if ($details) {
    echo $details->name;              // 'Google Australia'
    echo $details->phoneNumber;       // '(02) 9374 4000'
    echo $details->website;           // 'https://www.google.com.au/'
    echo $details->formattedAddress;  // '48 Pirrama Rd, Pyrmont NSW 2009, Australia'
    echo $details->rating;            // 4.4
    echo $details->userRatingsTotal;  // 123
    echo $details->latitude;          // -33.866651
    echo $details->longitude;         // 151.195827
}
```

### Dynamic API Keys (Multi-tenant support)

[](#dynamic-api-keys-multi-tenant-support)

If your application allows users to provide their own Google Maps API credentials, you can override the default API key fluently per-request:

```
use IllumaLaw\PlacesScout\Facades\PlacesScout;

$userApiKey = $user->settings->google_api_key;

// Override API key for this specific request
$response = PlacesScout::withApiKey($userApiKey)->textSearch('Restaurants in Paris');
```

### Dependency Injection

[](#dependency-injection)

Instead of the Facade, you can inject the `PlacesScoutService` directly into your controllers or jobs:

```
namespace App\Http\Controllers;

use IllumaLaw\PlacesScout\PlacesScoutService;

class LocationController extends Controller
{
    public function __construct(
        private PlacesScoutService $placesScout
    ) {}

    public function search(string $query)
    {
        $results = $this->placesScout->textSearch($query);

        return response()->json($results);
    }
}
```

Testing
-------

[](#testing)

The package includes a comprehensive Pest test suite and requires 100% test coverage.

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance91

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

5

Last Release

44d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2affac64f2726a640084b203503518ca01f582536d60a0a299b614486ed95aaa?d=identicon)[miguelenes](/maintainers/miguelenes)

---

Top Contributors

[![miguelenes](https://avatars.githubusercontent.com/u/1568086?v=4)](https://github.com/miguelenes "miguelenes (2 commits)")

---

Tags

laravelfluentdtoscoutgoogle placesplaces-api

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/illuma-law-laravel-places-scout/health.svg)

```
[![Health](https://phpackages.com/badges/illuma-law-laravel-places-scout/health.svg)](https://phpackages.com/packages/illuma-law-laravel-places-scout)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[spatie/laravel-health

Monitor the health of a Laravel application

88011.3M149](/packages/spatie-laravel-health)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)[api-platform/laravel

API Platform support for Laravel

59156.3k10](/packages/api-platform-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
