Download the PHP package ajthinking/laravel-postgis without Composer

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

Laravel Wrapper for PostgreSQL's Geo-Extension Postgis

Build Status

For Laravel 9+, PHP 8+ only

Features

Installation

Usage

To start, ensure you have PostGIS enabled in your database - you can do this in a Laravel migration or manually via SQL.

Enable PostGIS via a Laravel migration

You need to publish the migration to easily enable PostGIS:

And then you run the migrations:

These methods are safe to use and will only enable / disable the PostGIS extension if relevant - they won't cause an error if PostGIS is / isn't already enabled.

If you prefer, you can use the enablePostgis() method which will throw an error if PostGIS is already enabled, and the disablePostgis() method twhich will throw an error if PostGIS isn't enabled.

Enable PostGIS manually

Use an SQL client to connect to your database and run the following command:

CREATE EXTENSION postgis;

To verify that PostGIS is enabled you can run:

SELECT postgis_full_version();

Migrations

Now create a model with a migration by running

php artisan make:model Location

If you don't want a model and just a migration run

php artisan make:migration create_locations_table

Open the created migrations with your editor.

Available blueprint geometries:

other methods:

Models

All models which are to be PostGis enabled must use the PostgisTrait.

You must also define an array called $postgisFields which defines what attributes/columns on your model are to be considered geometry objects. By default, all attributes are of type geography. If you want to use geometry with a custom SRID, you have to define an array called $postgisTypes. The keys of this assoc array must match the entries in $postgisFields (all missing keys default to geography), the values are assoc arrays, too. They must have two keys: geomtype which is either geography or geometry and srid which is the desired SRID. Note: Custom SRID is only supported for geometry, not geography.

Available geometry classes:

Achnowledgements

This is a fork from the work of great people. Thanks to :


All versions of laravel-postgis with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
illuminate/database Version ^9.0
geo-io/wkb-parser Version ^1.0
jmikola/geojson Version ^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 ajthinking/laravel-postgis contains the following files

Loading the files please wait ....