PHPackages                             nemesis/laragis - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. nemesis/laragis

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nemesis/laragis
===============

A geospatial library and set of utilities for Laravel. This is fork from https://github.com/ralphschindler/laragis

1.0.3(9y ago)1116UNLICENSEPHPPHP &gt;=5.5

Since Apr 11Pushed 9y ago1 watchersCompare

[ Source](https://github.com/nemesis1988/laragis)[ Packagist](https://packagist.org/packages/nemesis/laragis)[ RSS](/packages/nemesis-laragis/feed)WikiDiscussions master Synced 4w ago

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

LaraGis
=======

[](#laragis)

LaraGis provides geospatial database and Eloquent features to Laravel.

Features:

- Simple Entity API, for use in casting model properties
- Fast serialization of geospatial data from MySql (not PHP userland) via `ST_AsGeoJSON()`

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

[](#installation)

To get started with Socialite, add to your `composer.json` file as a dependency:

```
composer require ralphschindler/laragis

```

### Configuration

[](#configuration)

After installing the Socialite library, register the `LaraGis\LaraGisProvider` in your `config/app.php` configuration file:

```
'providers' => [
    // Other service providers...

    LaraGis\LaraGisProvider::class,
],
```

Basic Usage
-----------

[](#basic-usage)

To use in `Eloquent` based models, use the `LaraGisTrait`, and specify a column to be cast into a geospatial datatype with the `laragis` key in the $casts array:

```
class Place extends Model
{
    use LaraGisTrait;

    protected $table = 'places';

    protected $casts = [
        'coordinates' => 'laragis'
    ];
}
```

```
$place = App\Places::find(1);
$coordinates = $place->coordinates;
echo $coordinates->getLatitudeLongitude(); // "30, -90"
```

Entity API
----------

[](#entity-api)

```
/**
 * @property double $latitude
 * @property double $longitude
 */
class Coordinates {
    public function __construct($latitude = null, $longitude = null);
    public function setLatitude($latitude);
    public function getLatitude();
    public function setLongitude($longitude);
    public function getLongitude();
    public function castToString($separator, $coordinatesOrder = self::LATITUDE_FIRST)
}

class Area implements \IteratorAggregate, \Countable {
    public function addCoordinates(Coordinates $coordinates);
    public function getCoordinates();
}
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

3

Last Release

3368d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8348454?v=4)[nemesis1988](/maintainers/nemesis1988)[@nemesis1988](https://github.com/nemesis1988)

---

Tags

phplaravelgisspatialgeogeospatial

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nemesis-laragis/health.svg)

```
[![Health](https://phpackages.com/badges/nemesis-laragis/health.svg)](https://phpackages.com/packages/nemesis-laragis)
```

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k8.2M84](/packages/stevebauman-location)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4535.7M4](/packages/martin-georgiev-postgresql-for-doctrine)[amranidev/laracombee

Recommendation system for laravel

11537.9k1](/packages/amranidev-laracombee)[yieldstudio/tailwind-merge-php

Merge Tailwind CSS classes without style conflicts

4974.6k1](/packages/yieldstudio-tailwind-merge-php)[foysal50x/h3-php

PHP FFI bindings for Uber's H3 hexagonal hierarchical geospatial indexing system

133.1k](/packages/foysal50x-h3-php)[wujunze/money-wrapper

MoneyPHP Wrapper

103.8k](/packages/wujunze-money-wrapper)

PHPackages © 2026

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