LaravelPackages.net
Acme Inc.
Toggle sidebar
apptimists/laravel-spatial

Spatial data types extension for Laravel.

191
4
About apptimists/laravel-spatial

apptimists/laravel-spatial is a Laravel package for spatial data types extension for laravel.. It currently has 4 GitHub stars and 191 downloads on Packagist. Install it with composer require apptimists/laravel-spatial. Discover more Laravel packages by apptimists or browse all Laravel packages to compare alternatives.

Last updated

Laravel Spatial extension

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();
Comments