Download the PHP package klentroxx/laravel-spatial without Composer

On this page you can find all versions of the php package klentroxx/laravel-spatial. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-spatial

Laravel Spatial

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

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

Getting Started

Installing the Package

You can install the package via composer:

Configuration

Default Configuration file includes geometry types mapping:

You can publish the config file with:

If you want you can override custom geometry types mapping:

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 $casts arrays and use the HasSpatial trait (fill the $fillable - optional):

Interacting with Spatial Data

After setting up your model, you can now create and access spatial data. Here's an example:

Further Reading

For more comprehensive documentation on the API, please refer to the API page.

Create queries only with scopes methods:

Extension

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:

Development

Here are some useful commands for development

Before running tests run db by docker-compose:

Run tests:

Run tests with coverage:

Perform type checking:

Format your code:

Updates and Changes

For details on updates and changes, please refer to our CHANGELOG.

License

Laravel Spatial is released under The MIT License (MIT). For more information, please see our License File.

Credits

Originally inspired from MatanYadaev's laravel-eloquent-spatial package. This package is a fork of Asanikovich's laravel-spatial package


All versions of laravel-spatial with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
ext-pdo Version *
laravel/framework Version ^10.0|^11.0
phayes/geophp Version ^1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package klentroxx/laravel-spatial contains the following files

Loading the files please wait ....