apptimists / laravel-spatial by johannesberdin

Spatial data types extension for Laravel.
191
4
3
Package Data
Maintainer Username: johannesberdin
Maintainer Contact: ich@johannesberdin.de (Johannes Berdin)
Package Create Date: 2017-05-11
Package Last Update: 2019-01-03
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2025-02-07 03:02:58
Package Statistics
Total Downloads: 191
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 4
Total Watchers: 3
Total Forks: 4
Total Open Issues: 3

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