Download the PHP package leitom/geo without Composer

On this page you can find all versions of the php package leitom/geo. 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 geo

A package that uses Redis geospatial functions for providing super fast searches.

Latest Version on Packagist Build Status Quality Score Total Downloads

This package makes it easy to add geospatial to your Laravel applications. It uses Redis built in geospatial features and combine this with your Laravel Models in an elegant way.

Installation

You can install the package via composer:

Usage

The package comes with a simple trait thats integrates with Laravel Eloquent models but also a facade to interact with the different geospatial functions.

Laravel Eloquent integration

All you have to do when integrating this package with one or more of your Eloquent models is to use the trait. This trait will take care of keeping the Redis index in sync with your models due to the use of a model observer so you dont have to think about it. Each time you create, save or delete a model the Redis index will be updated to reflect the changes.

Search

Here we perform a search with Longitude, Latitude and Radius. The unit of the radius is configured in the configuration file, default km = kilometers. With the 4. argument to the function you can specify the sorting, default .

The package adds two attributes to every model who implements the HasGeoAbilities. We add the unit and distance wich you can display to the end user.

The function is also overrided so that these two attributes would be loaded.

Find distance between two models

To find the distance between two models you can use the function on a given model

Get the nearest models

Perform a search via the facade

Get the distance between two locations

Get a list of the nearest locations from a given location

Add a coordinate to an index

Add multiple coordinates to an index

Remove coordinates from an index

Import and Remove existing models

The package include two commands to handle import and remove models from the Redis index. This is usefull if you integrate this package in an existing project.

Testing

Ensure you have Redis installed. If you are not using the default configuration for Redis you can change environment variables in the phpunit.xml file.

When testing you own application logic you should include the trait. This will ensure that you start with a fresh Redis index inside your tests. Just like the built in trait in Laravel.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.


All versions of geo with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
illuminate/support Version ^7.0
predis/predis Version ^1.1
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 leitom/geo contains the following files

Loading the files please wait ....