PHPackages                             unoapp-dev/laravel-geo - 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. unoapp-dev/laravel-geo

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

unoapp-dev/laravel-geo
======================

Spatial OGC objects integration for Laravel 5.\*

1.1.1(7y ago)1272GPL-3.0-onlyPHPPHP &gt;=5.4.0

Since Mar 17Pushed 7y agoCompare

[ Source](https://github.com/unoapp-dev/laravel-geo)[ Packagist](https://packagist.org/packages/unoapp-dev/laravel-geo)[ RSS](/packages/unoapp-dev-laravel-geo/feed)WikiDiscussions master Synced yesterday

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

Geo Laravel
===========

[](#geo-laravel)

This is a fork from [elevenlab/laravel-geo](https://github.com/eleven-lab/laravel-geo) with some modifications for compatibility with Lumen 5.6+

Features
========

[](#features)

- GeoSpatial integration on Laravel 5.2+:
    - Create geospatial columns using Schema and migrations
    - Save and retrieve geospatial attributes using directly OpenGeoConsortium Spatial Objects (this package depends from PHP-OGC)
    - Build spatial query directly with the laravel fluent query builder
    - Supported types: Point, MultiPoint, Linestring, MultiLinestring, Polygon, MultiPolygon, GeometryCollection
- Supported drivers:
    - Postgres: Posgis extension Extensions (geometry types)
    - MySql: Extension for Spatial Data (geography types)

Thanks to  for its original work.

Installation &amp; Configuration
================================

[](#installation--configuration)

1. Install using composer

```
$ composer require unoapp-dev/laravel-geo
```

2. Replace under the Service Providers section ('providers' array) in config/app.php this line

```
Illuminate\Database\DatabaseServiceProvider::class,
```

with this one:

```
ElevenLab\GeoLaravel\DatabaseServiceProvider::class
```

3. If you need it, under the Alias section ('aliases' array) in config/app.php add this line:

```
'GeoModel'      => ElevenLab\GeoLaravel\Model::class,
```

Quick Documentation
===================

[](#quick-documentation)

Create table with spatial references
------------------------------------

[](#create-table-with-spatial-references)

To add a geospatial field to your migration you can use these methods:

- point, multipoint linestring, multilinestring, polygon, multipolygon, geometrycollection

Example (NB: the schema is over-semplified):

```
