PHPackages                             ralphschindler/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. ralphschindler/laragis

ActiveLibrary

ralphschindler/laragis
======================

A geospatial library and set of utilities for Laravel

101101PHP

Since Jul 22Pushed 8y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)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

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

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

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

PHPackages © 2026

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