{"repo":"MatanYadaev/laravel-eloquent-spatial","free":true,"listed":false,"github":"https://github.com/MatanYadaev/laravel-eloquent-spatial","clone":"git clone https://github.com/MatanYadaev/laravel-eloquent-spatial.git","description":"Laravel Eloquent spatial package.","language":"PHP","stars":416,"topics":["laravel","eloquent","spatial","php"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Laravel Eloquent Spatial This package allows you to easily work with spatial data types and functions in Laravel and standalone Eloquent projects. Supported databases: - MySQL 8.4 - MariaDB 10.11 - Postgres 14/15/16/17/18 with PostGIS 3.4/3.5/3.6 Getting Started Installing the Package You can install the package via composer: Setting Up Your First Model 1. First, generate a new model along with a migration file by running: 2. Next, add some spatial columns to the migration file. For instance, to create a \"places\" table: 3. Run the migration: 4. In your new model, fill the $fillable and $casts arrays and use the HasSpatial trait: Interacting with Spatial Data After setting up your model, you can now create and access spatial data. Here's an example: Standalone Eloquent Usage (without Laravel) This package also works in projects that use Eloquent on its own, without the full Laravel framework. Just boot Eloquent — for example, with Illuminate\\Database\\Capsule\\Manager — and the spatial casts, scopes, and objects are ready to use: From there, models, casts, and query scopes behave exactly as in the examples above. Further Reading For more comprehensive documentation on the API, please refer to the API page. Extension Extend Geometry class with macros You can add new methods to the Geometry class through macros. Here's an example of how to register a macro in your service provider's boot method: Use the method in your code: Extend with custom geometry classes You can extend the ge","default_branch":null,"files":null,"tree":[],"storefront":"/r/MatanYadaev","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/MatanYadaev/laravel-eloquent-spatial/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}