Download the PHP package encima-io/nova-coordinates-postgis-fields without Composer

On this page you can find all versions of the php package encima-io/nova-coordinates-postgis-fields. 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 nova-coordinates-postgis-fields

Laravel Nova PostGIS Coordinates Field

Latest Version on Packagist License Total Downloads

Encima is a web-development team based in Oslo, Norway. You'll find more information about us on our website.

This package is made to allow you to easily view and update your PostGIS "geography" and "geometry" fields with Laravel Nova. To use this package you should of course already be using PostgreSQL with the PostGIS extension.

Installation

NB! This package is designed to be used for a POINT, a single location. If you are looking for something to update lines or multiple positions, then this package is not for you.

You can install the package via composer:

Usage

Migrations

You should have a column on the models table that is of the "geometry" type. This will create a "geography" type column on your table in the PostgreSQL database. This package also supports the "geometry" type.

Resource

On the Nova resource you should use the Encima\PostGIS\Latitude and Encima\PostGIS\Longitude fields in addition to the standard Laravel\Nova\Fields\Place field.

The values passed to the latitude() and longitude() methods on the Place field must be the same values as you pass to the second parameter in the Latitude and Longitude fields, see the example below. This is the ensures that the coordinates fetched by the Algolia API will get sent to the Latitude and Longitude fields.

Custom key-names on fields

If you however use the latitude and longitude keys for something else on you model, like an accessor or a column in your database, then you should change the keys to something thats available. When you use custom keys you need to let the fields know about their siblings field-key like this.

Column name

By default this package assumes your geography/geometry field is named position. If you are using another name for he column then you can specify this through the fromPosition(string $column) method. Here is an example, using the column name location:

Geometry

If your position column is of the geometry type, then you need to specify this through the dataType(string $name) method.

Cache

This package uses Laravels Cache facade, \Illuminate\Support\Facades\Cache, to reduce the amount of queries to the database. Since the coordinates needs a little trip to the database to be converted to the right format, we cache the result by default for 5 minutes, or until they are updated from the edit page.

For caching it uses your default cache store. You can change the cache store by with the cacheStore(string $store) method. You can also change the lifetime of the cache by using the cacheFor($ttl) method.

Example

Full example for a resource:

Disclaimer

There is some use of the DB::raw() method in this package. We have tried to sanitize the parameters, but you never know. Use this package at your own risk!

License

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


All versions of nova-coordinates-postgis-fields with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
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 encima-io/nova-coordinates-postgis-fields contains the following files

Loading the files please wait ....