PHPackages                             dynamicscreen/laravel-geographical - 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. dynamicscreen/laravel-geographical

AbandonedArchivedLibrary[Framework](/categories/framework)

dynamicscreen/laravel-geographical
==================================

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

1.0.2(6y ago)0252MITPHPPHP &gt;=5.6.4

Since Oct 1Pushed 6y agoCompare

[ Source](https://github.com/DynamicScreen/Laravel-Geographical)[ Packagist](https://packagist.org/packages/dynamicscreen/laravel-geographical)[ RSS](/packages/dynamicscreen-laravel-geographical/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Laravel Geographical
====================

[](#laravel-geographical)

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

First either update your database or add this to a migration for each model:

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

Finally in your model use:

```
use Geographical;
```

### 1. Distance

[](#1-distance)

Find the distance to all the entries in your table from a particular location.

```
$query = Model::distance($latitude, $longitude);
$asc = $query->orderBy('distance', 'ASC')->get();
```

### 2. Geofence

[](#2-geofence)

Find all the entries in your table inside a circular geo-fence.

```
$query = Model::geofence($latitude, $longitude, $inner_radius, $outer_radius);
$all = $query->get();
```

### Units

[](#units)

The default unit of distance is **miles**. You can change it to **kilometers** by putting this in your model

```
protected static $kilometers = true;
```

### Notes

[](#notes)

1. The method returns a `Eloquent\Builder` object so that you can add optional conditions if you want.
2. You can use `distance` as an aggregate column in the result. (Aggregate columns cannot be used in `WHERE`, use `HAVING` to execute any condition.)
3. If you use different column names for latitude and longitude, mention them in the Model.php

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

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

[](#installation)

[PHP](https://php.net) 5.6.4+ and [Laravel](http://laravel.com) 5+ are required.

To get the latest version of Laravel Geographical, simply require the project using [Composer](https://getcomposer.org):

```
$ composer require malhal/laravel-geographical
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 76.9% 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 ~538 days

Total

3

Last Release

2430d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/9b7abfcfb3f833e755d7db09aaa3e8759a6f4c892cddd8b07f1e63202a346b83?d=identicon)[cormarti](/maintainers/cormarti)

---

Top Contributors

[![malhal](https://avatars.githubusercontent.com/u/916912?v=4)](https://github.com/malhal "malhal (10 commits)")[![ashnehete](https://avatars.githubusercontent.com/u/7398393?v=4)](https://github.com/ashnehete "ashnehete (2 commits)")[![xitude](https://avatars.githubusercontent.com/u/3580195?v=4)](https://github.com/xitude "xitude (1 commits)")

---

Tags

frameworklaravelusermodelsgeographicallatitudelongitudeMalcolm HallmalhalLaravel Geographical

### Embed Badge

![Health badge](/badges/dynamicscreen-laravel-geographical/health.svg)

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

###  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)[digitalcloud/laravel-postgis

121.9k](/packages/digitalcloud-laravel-postgis)[akuechler/laravel-geoly

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

4258.3k](/packages/akuechler-laravel-geoly)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3691.5k](/packages/codewithdennis-larament)[kompo/kompo

Laravel &amp; Vue.js FullStack Components for Rapid Application Development

11812.4k21](/packages/kompo-kompo)[jsdecena/laravel-passport-multiauth

Simple laravel passport multiple user authentication

501.1k](/packages/jsdecena-laravel-passport-multiauth)

PHPackages © 2026

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