NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages

Validate place ids and coordinates in your own requests:

use RoundlyConsulting\GooglePlaces\Rules\ValidCoordinates;
use RoundlyConsulting\GooglePlaces\Rules\ValidPlaceId;

$request->validate([
    'place' => ['required', new ValidPlaceId],
    'point' => ['required', new ValidCoordinates], // Location, [lat, lng], or "lat,lng"
]);
  • ValidPlaceId — a string of 6–512 URL-safe base64 characters (letters, digits, _ and -), e.g. ChIJN1t_tDeuEmsRUsoyG83frY4.
  • ValidCoordinates — accepts a Location, a [lat, lng] array, a keyed array (lat/lng or latitude/longitude) or a “lat,lng” string; latitude must be within −90…90 and longitude within −180…180.

Both rules check format only — they never call Google, so they cost nothing.

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

By donating, you agree to our donation terms.

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.