apptimists / laravel-spatial
Spatial data types extension for Laravel.
dev-master / 1.0.x-dev
2017-11-15 18:20 UTC
Requires
- php: >=5.6.4
- illuminate/database: ^5.3
- jmikola/geojson: ^1.0
- phayes/geophp: ^1.2
Requires (Dev)
- mockery/mockery: 0.9.*
- phpunit/phpunit: ~5.0
This package is not auto-updated.
Last update: 2025-02-02 03:08:20 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();