PHPackages                             akuechler/laravel-geoly - 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. [Framework](/categories/framework)
4. /
5. akuechler/laravel-geoly

ActiveLibrary[Framework](/categories/framework)

akuechler/laravel-geoly
=======================

Perform fast and efficient radius searches on your Laravel Eloquent models.

v1.0.6(5y ago)4258.3k—0%2[1 issues](https://github.com/akuechler/laravel-geoly/issues)MITPHPPHP &gt;=7.1

Since Dec 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/akuechler/laravel-geoly)[ Packagist](https://packagist.org/packages/akuechler/laravel-geoly)[ RSS](/packages/akuechler-laravel-geoly/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (9)Used By (0)

Laravel Geoly
=============

[](#laravel-geoly)

[![Packagist Version](https://camo.githubusercontent.com/1eef237d376e9489054e2a909bd3b5e3cf5cd5073f8739cd0828365056136e31/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616b756563686c65722f6c61726176656c2d67656f6c79)](https://packagist.org/packages/akuechler/laravel-geoly)[![PHP from Packagist](https://camo.githubusercontent.com/cfa57c4c3be385836b6b51f27d778cd39ef4221a51b0e8b9c53eed3207b38050/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616b756563686c65722f6c61726176656c2d67656f6c79)](https://camo.githubusercontent.com/cfa57c4c3be385836b6b51f27d778cd39ef4221a51b0e8b9c53eed3207b38050/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616b756563686c65722f6c61726176656c2d67656f6c79)[![StyleCI](https://camo.githubusercontent.com/56a98299a386bc21f42e42cbc0f5642fe3a0d643eba9764515aeb9df3142bbd0/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3232363732363136392f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/226726169)[![GitHub](https://camo.githubusercontent.com/7c5ec03167da32a7a759fb3eb7aaf3dd1ae6b236e7964cad7f18915367c6f9e2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616b756563686c65722f6c61726176656c2d67656f6c79)](https://github.com/akuechler/laravel-geoly/blob/master/LICENSE)

Perform fast and efficient radius searches on your Laravel Eloquent models.

Laravel Geoly provides a convenient way for your Laravel Eloquent models to query in a certain radius around a position. It is lightning fast by using a bounding box to cut down the possible results and calculating the distance only on the remaining subset. Laravel Geoly works on both MySQL and PostgreSQL.

Requirements
------------

[](#requirements)

- PHP 7.1+
- Laravel 5+
- Tested on MySQL and PostgreSQL

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

[](#installation)

Simply require the project via composer:

`$ composer require akuechler/laravel-geoly`

How to use
----------

[](#how-to-use)

Geoly assumes the two columns `latitude` and `longitude` on your eloquent model. Simply add them to your migration if not present yet.

```
$table->double('latitude');
$table->double('longitude');
```

If you prefer to use other names for your database columns, specify them in your model.

```
const LATITUDE  = 'lat';
const LONGITUDE = 'lng';
```

Use the Geoly package within your Eloquent model.

```
class YourModel extends Model
{
    use Geoly;
    ...
}
```

To search for all models within a specific radius around a position, add the `radius` scope to your query.

```
$query = YourModel::radius($latitude, $longitude, $radius);
$query->get();
```

Credits
-------

[](#credits)

This project is heavily inspired by [Laravel Geographical](https://github.com/malhal/Laravel-Geographical) and [Movable Type Scripts](https://www.movable-type.co.uk/) article on [Selecting points within a bounding circle](https://www.movable-type.co.uk/scripts/latlong-db.html).

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community9

Small or concentrated contributor base

Maturity57

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 ~99 days

Recently: every ~124 days

Total

6

Last Release

1848d ago

PHP version history (2 changes)v1.0.1PHP &gt;=5.6.4

v1.0.5PHP &gt;=7.1

### Community

Maintainers

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

---

Top Contributors

[![axkuechler](https://avatars.githubusercontent.com/u/10256652?v=4)](https://github.com/axkuechler "axkuechler (8 commits)")

---

Tags

distancedistance-calculationeloquentgeolocationlaravellatitudelatitude-and-longitudelongitudemodelradiussearchsearchframeworklaravelmodelsgeolatitudelongitudedistanceradiuslatlnglon

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/akuechler-laravel-geoly/health.svg)

```
[![Health](https://phpackages.com/badges/akuechler-laravel-geoly/health.svg)](https://phpackages.com/packages/akuechler-laravel-geoly)
```

###  Alternatives

[malhal/laravel-geographical

Easily add longitude and latitude columns to your records and use inherited functionality for calculating distances

283375.6k](/packages/malhal-laravel-geographical)[jackpopp/geodistance

Search for locations within a radius using latitude and longitude values with your eloquent models.

125120.4k13](/packages/jackpopp-geodistance)[digitalcloud/laravel-postgis

121.9k](/packages/digitalcloud-laravel-postgis)[hemp/presenter

Easy Model Presenters in Laravel

247592.6k1](/packages/hemp-presenter)[rahulalam31/laravel-abuse-ip

Block ip address of all spammer's around the world.

27431.5k](/packages/rahulalam31-laravel-abuse-ip)[ballen/distical

A distance (Lat/Long) calculation library for PHP

40180.2k2](/packages/ballen-distical)

PHPackages © 2026

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