apptimists/laravel-spatial

Spatial data types extension for Laravel.

Maintainers

👁 johannesberdin

Package info

github.com/apptimists/laravel-spatial

pkg:composer/apptimists/laravel-spatial

Statistics

Installs: 191

Dependents: 0

Suggesters: 0

Stars: 4

Open Issues: 3

dev-master / 1.0.x-dev 2017-11-15 18:20 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 8f613a0af7bbcc7eacdfe8738f104bd345f866c5

  • Johannes Berdin <ich.woop@johannesberdin.de>

This package is not auto-updated.

Last update: 2026-06-21 10:21:12 UTC


README

This package is fully untested, undocumented and unstable and is a combination of the two great packages:

Installation

Installation made super-easy with composer:

composer require apptimists/laravel-spatial

Also add the LaravelSpatial\SpatialServiceProvider::class to your config/app.php.

Requirements

Works with PostgreSQL installed PostGIS extension and MySQL at least version 5.6.

If you try using it on a shared host which is not fulfilling those requirements, change your provider.

Usage

We use the GeoJson PHP Library for describing spatial fields as GeoJSON object, e.g.:

use GeoJSON\Geometry\Point;
 
...
 
$eloquent = new MyModel();
$eloquent->location = new Point([49.7, 6.9]);
 
...
 
$eloquent->save();