PHPackages                             asanikovich/laravel-spatial - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. asanikovich/laravel-spatial

ActiveLibrary[Database &amp; ORM](/categories/database)

asanikovich/laravel-spatial
===========================

Laravel Eloquent spatial package

v2.0.1(2y ago)2512.3k↓47.8%6[4 PRs](https://github.com/asanikovich/laravel-spatial/pulls)MITPHPPHP ^8.1

Since Jun 2Pushed 1y ago2 watchersCompare

[ Source](https://github.com/asanikovich/laravel-spatial)[ Packagist](https://packagist.org/packages/asanikovich/laravel-spatial)[ Docs](https://github.com/asanikovich/laravel-spatial)[ RSS](/packages/asanikovich-laravel-spatial/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (8)Versions (12)Used By (0)

Laravel Spatial
===============

[](#laravel-spatial)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4ed2f17d89010e1eae65a02166c184d47ab0c3588c25acbcf924d0152d687635/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6173616e696b6f766963682f6c61726176656c2d7370617469616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asanikovich/laravel-spatial)[![GitHub Tests Status](https://camo.githubusercontent.com/0fd06c4365351e2e54b4cef476498162abafb75506ff770857c54c093e08bb1e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6173616e696b6f766963682f6c61726176656c2d7370617469616c2f706573742e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/asanikovich/laravel-spatial/actions/workflows/pest.yml?query=branch%3Amaster)[![GitHub Tests Coverage Status](https://camo.githubusercontent.com/3ab072d9b713609a4fea5e89fdb38e9f1d128eb852b763fa316c816bdb3ec7f6/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6173616e696b6f766963682f6c61726176656c2d7370617469616c3f746f6b656e3d45303730334f30505054267374796c653d666c61742d737175617265)](https://github.com/asanikovich/laravel-spatial/actions/workflows/pest-coverage.yml?query=branch%3Amaster)[![GitHub Code Style Status](https://camo.githubusercontent.com/6ae53b0c6b9eceb20e19fc39d9dc29d6a035d22f97a03534ac7dd255d14ef9a4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6173616e696b6f766963682f6c61726176656c2d7370617469616c2f7068707374616e2e796d6c3f6272616e63683d6d6173746572266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/asanikovich/laravel-spatial/actions/workflows/phpstan.yml?query=branch%3Amaster)[![GitHub Lint Status](https://camo.githubusercontent.com/8bbfe4a06c4b9a6e17902227f1f74c3abb2eb9abe814b64391177b831ceb2ae9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6173616e696b6f766963682f6c61726176656c2d7370617469616c2f70696e742e796d6c3f6272616e63683d6d6173746572266c6162656c3d6c696e74267374796c653d666c61742d737175617265)](https://github.com/asanikovich/laravel-spatial/actions/workflows/pint.yml?query=branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/457fa2eca6d7a9076d1611a3b49fe65fe204241d0fe893c503ea0763c9a625c8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6173616e696b6f766963682f6c61726176656c2d7370617469616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asanikovich/laravel-spatial)[![Licence](https://camo.githubusercontent.com/b305f924290a198f28b34132109d63fb7ae5aa25745aab711363ef966d5dc9ad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6173616e696b6f766963682f6c61726176656c2d7370617469616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asanikovich/laravel-spatial)

**This Laravel package allows you to easily work with spatial data types and functions.**

- v2 supports Laravel 10+ and PHP 8.1+
- v1 supports Laravel 8,9 and PHP 8.1+

This package supports MySQL v8 or v5.7, and MariaDB v10.

Getting Started
---------------

[](#getting-started)

### Installing the Package

[](#installing-the-package)

You can install the package via composer:

```
composer require asanikovich/laravel-spatial
```

### Configuration

[](#configuration)

Default Configuration file includes geometry types mapping:

```
