Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Laravel Spatial extension

This package is fully untested, undocumented and unstable and is a combination of the two great packages:
- [Laravel PostGIS extension](https://github.com/njbarrett/laravel-postgis)
- [Laravel MySQL spatial extension](https://github.com/grimzy/laravel-mysql-spatial)

- [Laravel PostGIS extension](https://github.com/njbarrett/laravel-postgis)
- [Laravel MySQL spatial extension](https://github.com/grimzy/laravel-mysql-spatial)

## Installation

Installation made super-easy with [composer](https://getcomposer.org):
```

```bash
composer require apptimists/laravel-spatial
```

Also add the `LaravelSpatial\SpatialServiceProvider::class` to your `config/app.php`.
If you're using a Laravel version before 5.5, also add the `LaravelSpatial\SpatialServiceProvider::class` to your `config/app.php`.

## Requirements

Expand All @@ -22,15 +24,16 @@ If you try using it on a shared host which is not fulfilling those requirements,
## Usage

We use the [GeoJson PHP Library](http://jmikola.github.io/geojson/) for describing spatial fields as GeoJSON object, e.g.:
```

```php
use GeoJSON\Geometry\Point;

...

$eloquent = new MyModel();
$eloquent->location = new Point([49.7, 6.9]);

...

$eloquent->save();
```
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
}
},
"extra": {
"laravel": {
"providers": [
"LaravelSpatial\\SpatialServiceProvider"
]
},
"branch-alias": {
"dev-master": "1.0.x-dev"
}
Expand Down