Skip to content

Commit 68117d3

Browse files
committed
prepare to release as standalone package
1 parent 085c618 commit 68117d3

File tree

5 files changed

+44
-89
lines changed

5 files changed

+44
-89
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ body:
4444
attributes:
4545
label: Laravel Version
4646
description: What version of Laravel are you running? Please be as specific as possible
47-
placeholder: 9.0.0
47+
placeholder: 10.0.0
4848
validations:
4949
required: true
5050
- type: dropdown

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com/grimzy/laravel-mysql-spatial/discussions/new?category=q-a
4+
url: https://github.com/limenet/laravel-mysql-spatial/discussions/new?category=q-a
55
about: Ask the community for help
66
- name: Request a feature
7-
url: https://github.com/grimzy/laravel-mysql-spatial/discussions/new?category=ideas
7+
url: https://github.com/limenet/laravel-mysql-spatial/discussions/new?category=ideas
88
about: Share ideas for new features
99
- name: Report a security issue
10-
url: https://github.com/grimzy/laravel-mysql-spatial/security/policy
10+
url: https://github.com/limenet/laravel-mysql-spatial/security/policy
1111
about: Learn how to notify us for sensitive bugs

LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ MIT License
22

33
Original work Copyright (c) 2015 Peter Haza
44
Modified work Copyright (c) 2017 Joseph Estefane
5+
Modified work Copyright (c) 2023 Linus Metzler
56

67
Permission is hereby granted, free of charge, to any person obtaining a copy
78
of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +20,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1920
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2021
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2122
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22-
SOFTWARE.
23+
SOFTWARE.

README.md

Lines changed: 20 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
# Laravel MySQL Spatial extension
22

3-
[![Build Status](https://img.shields.io/travis/grimzy/laravel-mysql-spatial.svg?style=flat-square)](https://travis-ci.org/grimzy/laravel-mysql-spatial)
4-
[![Code Climate](https://img.shields.io/codeclimate/maintainability/grimzy/laravel-mysql-spatial.svg?style=flat-square)](https://codeclimate.com/github/grimzy/laravel-mysql-spatial/maintainability)
5-
[![Code Climate](https://img.shields.io/codeclimate/c/grimzy/laravel-mysql-spatial.svg?style=flat-square&colorB=4BCA2A)](https://codeclimate.com/github/grimzy/laravel-mysql-spatial/test_coverage) [![Packagist](https://img.shields.io/packagist/v/grimzy/laravel-mysql-spatial.svg?style=flat-square)](https://packagist.org/packages/grimzy/laravel-mysql-spatial)
6-
[![Packagist](https://img.shields.io/packagist/dt/grimzy/laravel-mysql-spatial.svg?style=flat-square)](https://packagist.org/packages/grimzy/laravel-mysql-spatial) [![StyleCI](https://github.styleci.io/repos/83766141/shield?branch=master)](https://github.styleci.io/repos/83766141)
7-
[![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](LICENSE)
3+
[![Packagist](https://img.shields.io/packagist/dt/limenet/laravel-mysql-spatial.svg?style=flat-square)](https://packagist.org/packages/limenet/laravel-mysql-spatial)
4+
[![license](https://img.shields.io/github/license/limenet/laravel-mysql-spatial.svg?style=flat-square)](LICENSE)
85

96
Laravel package to easily work with [MySQL Spatial Data Types](https://dev.mysql.com/doc/refman/8.0/en/spatial-type-overview.html) and [MySQL Spatial Functions](https://dev.mysql.com/doc/refman/8.0/en/spatial-function-reference.html).
107

118
Please check the documentation for your MySQL version. MySQL's Extension for Spatial Data was added in MySQL 5.5 but many Spatial Functions were changed in 5.6 and 5.7.
129

13-
**Versions**
14-
15-
- `1.x.x`: MySQL 5.6 (also supports MySQL 5.5 but not all spatial analysis functions)
16-
- `2.x.x`: MySQL 5.7 and 8.0 (Laravel version < 8.0)
17-
- `3.x.x`: MySQL 8.0 with SRID support (Laravel version < 8.0)
18-
- **`4.x.x`: MySQL 8.0 with SRID support (Laravel 8+) [Current branch]**
19-
- `5.x.x`: MySQL 5.7 and 8.0 (Laravel 8+)
10+
**This package is a fork of https://github.com/grimzy/laravel-mysql-spatial and virtually all code was written by the contributors to that repo. Thank you!**
2011

2112
This package also works with MariaDB. Please refer to the [MySQL/MariaDB Spatial Support Matrix](https://mariadb.com/kb/en/library/mysqlmariadb-spatial-support-matrix/) for compatibility.
2213

@@ -25,34 +16,10 @@ This package also works with MariaDB. Please refer to the [MySQL/MariaDB Spatial
2516
Add the package using composer:
2617

2718
```sh
28-
$ composer require grimzy/laravel-mysql-spatial:^4.0
29-
30-
# or for Laravel version < 8.0
31-
$ composer require grimzy/laravel-mysql-spatial:^3.0
32-
```
33-
34-
For MySQL 5.7:
35-
36-
```shell
37-
$ composer require grimzy/laravel-mysql-spatial:^2.0
19+
$ composer require limenet/laravel-mysql-spatial
3820
```
3921

40-
For MySQL 5.6 and 5.5:
41-
42-
```shell
43-
$ composer require grimzy/laravel-mysql-spatial:^1.0
44-
```
45-
46-
For Laravel versions before 5.5 or if not using auto-discovery, register the service provider in `config/app.php`:
47-
48-
```php
49-
'providers' => [
50-
/*
51-
* Package Service Providers...
52-
*/
53-
Grimzy\LaravelMysqlSpatial\SpatialServiceProvider::class,
54-
],
55-
```
22+
If you need support for older versions, please consider using the package `grimzy/laravel-mysql-spatial` instead.
5623

5724
## Quickstart
5825

@@ -70,17 +37,8 @@ Then edit the migration you just created by adding at least one spatial data fie
7037
use Illuminate\Database\Migrations\Migration;
7138
use Illuminate\Database\Schema\Blueprint;
7239

73-
// For Laravel < 5.5
74-
// use Grimzy\LaravelMysqlSpatial\Schema\Blueprint;
75-
7640
class CreatePlacesTable extends Migration {
77-
78-
/**
79-
* Run the migrations.
80-
*
81-
* @return void
82-
*/
83-
public function up()
41+
public function up(): void
8442
{
8543
Schema::create('places', function(Blueprint $table)
8644
{
@@ -92,9 +50,9 @@ class CreatePlacesTable extends Migration {
9250
$table->polygon('area')->nullable();
9351
$table->timestamps();
9452
});
95-
53+
9654
// Or create the spatial fields with an SRID (e.g. 4326 WGS84 spheroid)
97-
55+
9856
// Schema::create('places', function(Blueprint $table)
9957
// {
10058
// $table->increments('id');
@@ -107,12 +65,7 @@ class CreatePlacesTable extends Migration {
10765
// });
10866
}
10967

110-
/**
111-
* Reverse the migrations.
112-
*
113-
* @return void
114-
*/
115-
public function down()
68+
public function down(): void
11669
{
11770
Schema::drop('places');
11871
}
@@ -226,15 +179,15 @@ $lng = $place2->location->getLng(); // -73.9878441
226179

227180
### Available Geometry classes
228181

229-
| Grimzy\LaravelMysqlSpatial\Types | OpenGIS Class |
230-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
231-
| `Point($lat, $lng, $srid = 0)` | [Point](https://dev.mysql.com/doc/refman/8.0/en/gis-class-point.html) |
232-
| `MultiPoint(Point[], $srid = 0)` | [MultiPoint](https://dev.mysql.com/doc/refman/8.0/en/gis-class-multipoint.html) |
233-
| `LineString(Point[], $srid = 0)` | [LineString](https://dev.mysql.com/doc/refman/8.0/en/gis-class-linestring.html) |
234-
| `MultiLineString(LineString[], $srid = 0)` | [MultiLineString](https://dev.mysql.com/doc/refman/8.0/en/gis-class-multilinestring.html) |
235-
| `Polygon(LineString[], $srid = 0)` *([exterior and interior boundaries](https://dev.mysql.com/doc/refman/8.0/en/gis-class-polygon.html))* | [Polygon](https://dev.mysql.com/doc/refman/8.0/en/gis-class-polygon.html) |
236-
| `MultiPolygon(Polygon[], $srid = 0)` | [MultiPolygon](https://dev.mysql.com/doc/refman/8.0/en/gis-class-multipolygon.html) |
237-
| `GeometryCollection(Geometry[], $srid = 0)` | [GeometryCollection](https://dev.mysql.com/doc/refman/8.0/en/gis-class-geometrycollection.html) |
182+
| `Grimzy\LaravelMysqlSpatial\Types` | OpenGIS Class |
183+
| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
184+
| `Point($lat, $lng, $srid = 0)` | [Point](https://dev.mysql.com/doc/refman/8.0/en/gis-class-point.html) |
185+
| `MultiPoint(Point[], $srid = 0)` | [MultiPoint](https://dev.mysql.com/doc/refman/8.0/en/gis-class-multipoint.html) |
186+
| `LineString(Point[], $srid = 0)` | [LineString](https://dev.mysql.com/doc/refman/8.0/en/gis-class-linestring.html) |
187+
| `MultiLineString(LineString[], $srid = 0)` | [MultiLineString](https://dev.mysql.com/doc/refman/8.0/en/gis-class-multilinestring.html) |
188+
| `Polygon(LineString[], $srid = 0)` *([exterior and interior boundaries](https://dev.mysql.com/doc/refman/8.0/en/gis-class-polygon.html))* | [Polygon](https://dev.mysql.com/doc/refman/8.0/en/gis-class-polygon.html) |
189+
| `MultiPolygon(Polygon[], $srid = 0)` | [MultiPolygon](https://dev.mysql.com/doc/refman/8.0/en/gis-class-multipolygon.html) |
190+
| `GeometryCollection(Geometry[], $srid = 0)` | [GeometryCollection](https://dev.mysql.com/doc/refman/8.0/en/gis-class-geometrycollection.html) |
238191

239192
Check out the [Class diagram](https://user-images.githubusercontent.com/1837678/30788608-a5afd894-a16c-11e7-9a51-0a08b331d4c4.png).
240193

@@ -403,7 +356,7 @@ class UpdatePlacesTable extends Migration
403356
Schema::table('places', function (Blueprint $table) {
404357
// Make sure point is not nullable
405358
$table->point('location')->change();
406-
359+
407360
// Add a spatial index on the location field
408361
$table->spatialIndex('location');
409362
});
@@ -433,9 +386,6 @@ class UpdatePlacesTable extends Migration
433386

434387
```shell
435388
$ composer test
436-
# or
437-
$ composer test:unit
438-
$ composer test:integration
439389
```
440390

441391
Integration tests require a running MySQL database. If you have Docker installed, you can start easily start one:
@@ -448,7 +398,7 @@ $ make start_db V=5.7 # starts MySQL 5.7
448398

449399
## Contributing
450400

451-
Recommendations and pull request are most welcome! Pull requests with tests are the best! There are still a lot of MySQL spatial functions to implement or creative ways to use spatial functions.
401+
Recommendations and pull request are most welcome! Pull requests with tests are the best! There are still a lot of MySQL spatial functions to implement or creative ways to use spatial functions.
452402

453403
## Credits
454404

composer.json

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
{
2-
"name": "grimzy/laravel-mysql-spatial",
2+
"name": "limenet/laravel-mysql-spatial",
33
"description": "MySQL spatial data types extension for Laravel.",
4-
"homepage": "https://github.com/grimzy/laravel-mysql-spatial",
4+
"homepage": "https://github.com/limenet/laravel-mysql-spatial",
55
"scripts": {
66
"post-autoload-dump": "@php ./vendor/bin/testbench package:discover --ansi",
77
"analyse": "vendor/bin/phpstan analyse",
88
"test": "vendor/bin/phpunit",
99
"test-coverage": "vendor/bin/phpunit --coverage",
10-
"format": "vendor/bin/pint"
10+
"format": "vendor/bin/pint",
11+
"post-update-cmd": "@composer bump -D"
1112
},
1213
"type": "library",
1314
"license": "MIT",
1415
"authors": [
1516
{
1617
"name": "Joseph Estefane",
1718
"email": "[email protected]"
19+
},
20+
{
21+
"name": "Linus Metzler",
22+
"email": "[email protected]"
1823
}
1924
],
2025
"require": {
@@ -29,17 +34,17 @@
2934
},
3035
"conflict": {},
3136
"require-dev": {
32-
"laravel/pint": "^1.6",
33-
"laravel/laravel": "^10.0.4",
37+
"laravel/pint": "^1.10.3",
38+
"laravel/laravel": "^10.2.4",
3439
"laravel/browser-kit-testing": "^7.0",
35-
"mockery/mockery": "^1.5.1",
36-
"nunomaduro/collision": "^7.1.0",
37-
"nunomaduro/larastan": "^2.5.1",
38-
"orchestra/testbench": "^8.0.8",
39-
"phpstan/extension-installer": "^1.2",
40-
"phpstan/phpstan-deprecation-rules": "^1.1.2",
41-
"phpstan/phpstan-phpunit": "^1.3.10",
42-
"phpunit/phpunit": "^10.0.15"
40+
"mockery/mockery": "^1.6.2",
41+
"nunomaduro/collision": "^7.7.0",
42+
"nunomaduro/larastan": "^2.6.3",
43+
"orchestra/testbench": "^8.5.9",
44+
"phpstan/extension-installer": "^1.3.1",
45+
"phpstan/phpstan-deprecation-rules": "^1.1.3",
46+
"phpstan/phpstan-phpunit": "^1.3.13",
47+
"phpunit/phpunit": "^10.2.3"
4348
},
4449
"autoload": {
4550
"psr-4": {
@@ -54,7 +59,6 @@
5459
"config": {
5560
"sort-packages": true,
5661
"allow-plugins": {
57-
"pestphp/pest-plugin": true,
5862
"phpstan/extension-installer": true
5963
}
6064
},

0 commit comments

Comments
 (0)