From 5b49e1ca09b138a1210cd0387b647c67fbd503c5 Mon Sep 17 00:00:00 2001 From: Fadi Hassan Date: Thu, 13 Feb 2025 01:53:56 +0300 Subject: [PATCH 01/10] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4451cb50..0335943d 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "php": ">=7.3", "ext-pdo": "*", "ext-json": "*", - "illuminate/database": "^8.0", + "illuminate/database": "^9.0", "geo-io/wkb-parser": "^1.0", "jmikola/geojson": "^1.0" }, From 690c2ee4d281df3129e46592e7959d2772fd45a2 Mon Sep 17 00:00:00 2001 From: Fadi Hassan Date: Thu, 13 Feb 2025 02:14:06 +0300 Subject: [PATCH 02/10] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0335943d..c7985c71 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "test:unit": "phpunit -c phpunit.xml.dist --testsuite unit", "test:integration": "phpunit -c phpunit.xml.dist --testsuite integration" }, - "type": "library", + "type": "wordpress-theme", "license": "MIT", "authors": [ { From 3a58dd756482fd4eb6f883e683ca2fa8fce5a542 Mon Sep 17 00:00:00 2001 From: Fadi Hassan Date: Tue, 15 Apr 2025 00:30:14 +0300 Subject: [PATCH 03/10] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c7985c71..67cf4aaf 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "php": ">=7.3", "ext-pdo": "*", "ext-json": "*", - "illuminate/database": "^9.0", + "illuminate/database": "^10.0", "geo-io/wkb-parser": "^1.0", "jmikola/geojson": "^1.0" }, From 96bf43e8f45cfed77cb3e551d2059a56740cd265 Mon Sep 17 00:00:00 2001 From: Fadi Hassan Date: Tue, 15 Apr 2025 00:46:06 +0300 Subject: [PATCH 04/10] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 67cf4aaf..c7985c71 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "php": ">=7.3", "ext-pdo": "*", "ext-json": "*", - "illuminate/database": "^10.0", + "illuminate/database": "^9.0", "geo-io/wkb-parser": "^1.0", "jmikola/geojson": "^1.0" }, From 5803985048e3df43e8b2f22a82aa9819ae4b59e2 Mon Sep 17 00:00:00 2001 From: Fadi Hassan Date: Tue, 15 Apr 2025 00:56:26 +0300 Subject: [PATCH 05/10] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c7985c71..67cf4aaf 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "php": ">=7.3", "ext-pdo": "*", "ext-json": "*", - "illuminate/database": "^9.0", + "illuminate/database": "^10.0", "geo-io/wkb-parser": "^1.0", "jmikola/geojson": "^1.0" }, From 3e610bbed657933b2eee65411b6d8dce7af0a263 Mon Sep 17 00:00:00 2001 From: Fadi Hassan Date: Tue, 15 Apr 2025 01:38:54 +0300 Subject: [PATCH 06/10] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 67cf4aaf..491fb841 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "php": ">=7.3", "ext-pdo": "*", "ext-json": "*", - "illuminate/database": "^10.0", + "illuminate/database": "^11.0", "geo-io/wkb-parser": "^1.0", "jmikola/geojson": "^1.0" }, From bd3a4442854d797c1e0038d50d047d8da91b4968 Mon Sep 17 00:00:00 2001 From: Fadi Hassan Date: Tue, 15 Apr 2025 01:42:19 +0300 Subject: [PATCH 07/10] Update composer.json --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 491fb841..364b6238 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,6 @@ "php": ">=7.3", "ext-pdo": "*", "ext-json": "*", - "illuminate/database": "^11.0", "geo-io/wkb-parser": "^1.0", "jmikola/geojson": "^1.0" }, From b92770c7202ed41bd4cb580a233973c7148c6628 Mon Sep 17 00:00:00 2001 From: Fadi Hassan Date: Tue, 15 Apr 2025 13:58:31 +0300 Subject: [PATCH 08/10] Update SpatialExpression.php --- src/Eloquent/SpatialExpression.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Eloquent/SpatialExpression.php b/src/Eloquent/SpatialExpression.php index 9224af0f..b3690807 100644 --- a/src/Eloquent/SpatialExpression.php +++ b/src/Eloquent/SpatialExpression.php @@ -3,10 +3,11 @@ namespace Grimzy\LaravelMysqlSpatial\Eloquent; use Illuminate\Database\Query\Expression; +use Illuminate\Database\Grammar; class SpatialExpression extends Expression { - public function getValue() + public function getValue(Grammar $grammar) { return "ST_GeomFromText(?, ?, 'axis-order=long-lat')"; } From 246c7257af601c381102ffe51e30ebaecbde5712 Mon Sep 17 00:00:00 2001 From: Fadi Hassan Date: Wed, 16 Apr 2025 19:45:59 +0300 Subject: [PATCH 09/10] Update Blueprint.php --- src/Schema/Blueprint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Schema/Blueprint.php b/src/Schema/Blueprint.php index 0a333f06..2f4d1a84 100644 --- a/src/Schema/Blueprint.php +++ b/src/Schema/Blueprint.php @@ -14,7 +14,7 @@ class Blueprint extends IlluminateBlueprint * * @return \Illuminate\Support\Fluent */ - public function geometry($column, $srid = null) + public function geometry($column, $subtype = null, $srid = 0) { return $this->addColumn('geometry', $column, compact('srid')); } From b914cdc327d1b59a7431a9e6205fa74ebf562b9c Mon Sep 17 00:00:00 2001 From: Fadi Date: Thu, 31 Jul 2025 17:24:36 +0300 Subject: [PATCH 10/10] Fix Laravel 12 compatibility issues - Update MySqlGrammar constructor to accept Connection parameter - Fix getDefaultSchemaGrammar() to pass connection to grammar - Update createBlueprint() to pass connection parameter - Resolves 'Call to a member function compileTableExists() on null' error These changes ensure compatibility with Laravel 12's updated database layer architecture. --- src/MysqlConnection.php | 2 +- src/Schema/Builder.php | 2 +- src/Schema/Grammars/MySqlGrammar.php | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/MysqlConnection.php b/src/MysqlConnection.php index 38a2b1a4..1b7b4d08 100644 --- a/src/MysqlConnection.php +++ b/src/MysqlConnection.php @@ -40,7 +40,7 @@ public function __construct($pdo, $database = '', $tablePrefix = '', array $conf */ protected function getDefaultSchemaGrammar() { - return $this->withTablePrefix(new MySqlGrammar()); + return new MySqlGrammar($this); } /** diff --git a/src/Schema/Builder.php b/src/Schema/Builder.php index baf8dc58..993f32ef 100644 --- a/src/Schema/Builder.php +++ b/src/Schema/Builder.php @@ -17,6 +17,6 @@ class Builder extends MySqlBuilder */ protected function createBlueprint($table, Closure $callback = null) { - return new Blueprint($table, $callback); + return new Blueprint($this->connection, $table, $callback); } } diff --git a/src/Schema/Grammars/MySqlGrammar.php b/src/Schema/Grammars/MySqlGrammar.php index 9afe4513..e1a2c4bb 100644 --- a/src/Schema/Grammars/MySqlGrammar.php +++ b/src/Schema/Grammars/MySqlGrammar.php @@ -10,8 +10,10 @@ class MySqlGrammar extends IlluminateMySqlGrammar { const COLUMN_MODIFIER_SRID = 'Srid'; - public function __construct() + public function __construct(\Illuminate\Database\Connection $connection) { + parent::__construct($connection); + // Enable SRID as a column modifier if (!in_array(self::COLUMN_MODIFIER_SRID, $this->modifiers)) { $this->modifiers[] = self::COLUMN_MODIFIER_SRID;