PHPackages                             adamcmoore/laravel-location-validator - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. adamcmoore/laravel-location-validator

ActivePackage[Validation &amp; Sanitization](/categories/validation)

adamcmoore/laravel-location-validator
=====================================

A Laravel validation rule to check that a lng/lat pair are within an area.

v10.1(2y ago)151[1 PRs](https://github.com/adamcmoore/laravel-location-validator/pulls)MITPHPPHP ^8.1

Since Jan 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/adamcmoore/laravel-location-validator)[ Packagist](https://packagist.org/packages/adamcmoore/laravel-location-validator)[ RSS](/packages/adamcmoore-laravel-location-validator/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (7)Versions (7)Used By (0)

Laravel Location Validator
--------------------------

[](#laravel-location-validator)

A Laravel validation rule to check that a lng/lat pair are within an area.

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

[](#installation)

```
composer require adamcmoore/laravel-location-validator
```

Usage
-----

[](#usage)

```
use AcMoore\LocationValidator\LocationValidator;

// Validate that latitude & longitude is inside an area
$allowed_area = [
	[48.9675969, 1.7440796],
	[48.4711003, 2.5268555],
	[48.9279131, 3.1448364],
	[49.3895245, 2.6119995],
];
$request->validate(
	[
		'latitude'  => 'latitude',
		'longitude' => 'longitude',
	],
	[
		'latitude' => new LocationValidator(
			$request->get('longitude'), // Longitude needs to be supplied as an argument when using a Rule Object
			$allowed_area
		)
	]
);

### Todo
- [ ] Add support for latitude & lognitude in same field, like spatial fields or comma seperated.
- [ ] Allow multiple areas.
- [ ] Add validation rule to `Validator::extend` in a service provider.
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 81.8% 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 ~314 days

Total

5

Last Release

1090d ago

Major Versions

v1.2 → v10.02023-05-02

PHP version history (4 changes)v1.0PHP &gt;=7.0.13

v1.1PHP &gt;=7.2

v1.2PHP &gt;=7.3

v10.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/fbab38a8b9f83883889deadfa1c407c2282a9f6d80175f1c5633abca9d2bf402?d=identicon)[adamcmoore](/maintainers/adamcmoore)

---

Top Contributors

[![adamcmoore](https://avatars.githubusercontent.com/u/5844678?v=4)](https://github.com/adamcmoore "adamcmoore (9 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

laravelvalidatorlocation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/adamcmoore-laravel-location-validator/health.svg)

```
[![Health](https://phpackages.com/badges/adamcmoore-laravel-location-validator/health.svg)](https://phpackages.com/packages/adamcmoore-laravel-location-validator)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

9782.1M162](/packages/laravel-ai)[larastan/larastan

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

6.4k51.0M7.6k](/packages/larastan-larastan)[illuminate/queue

The Illuminate Queue package.

20432.2M1.5k](/packages/illuminate-queue)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9742.3M121](/packages/roots-acorn)[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M153](/packages/spatie-laravel-health)[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

761621.7k17](/packages/wendelladriel-laravel-validated-dto)

PHPackages © 2026

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