grimzy / laravel-mysql-spatial

MySQL Spatial Data Extension integration with Laravel.
Other
795 stars 316 forks source link

Support for Laravel 11 #215

Open jangaraev opened 2 months ago

jangaraev commented 2 months ago

hi guys,

once observed that the package doesn't support Laravel v11, I quickly tried to align that by forking the package and modifying it's dependencies like follows:

composer.json

    "require": {
        ...
        "illuminate/database": "^8.0|^9.0|^10.0|^11.0",
        ...
    },

this made me possible to install my fork into my Laravel application.

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/jangaraev/laravel-mysql-spatial.git"
        }
    ]
}
{
    "require": {
        "grimzy/laravel-mysql-spatial": "@dev",
    }
}

next, I faced the fatal error during package auto-discover of composer update command:

Method Grimzy\LaravelMysqlSpatial\MysqlConnection::getDoctrineSchemaManager does not exist.

the thing is L11 removed several DBAL methods: https://laravel.com/docs/11.x/upgrade#doctrine-dbal-removal

under the hood, the package tries to detect the DB platform here and register geo specific types:

https://github.com/grimzy/laravel-mysql-spatial/blob/2ca9f2f25cf10e3b4771881108ecc9c69317bf57/src/MysqlConnection.php#L29

this method doesn't exist in L11. unfortunately, this was a breaking change for the package.

I'll try to look for a workaround.

please feel free to share your experience if you also tried to make it work in L11.

stefanrakicfaxi commented 1 month ago

@grimzy It would be great if you could check this PRs and make a new release with support for Laravel 11

Shailesh-Kala commented 2 weeks ago

@jangaraev @stefanrakicfaxi have you guys found any workaround for this error:

Method Grimzy\LaravelMysqlSpatial\MysqlConnection::getDoctrineSchemaManager does not exist.

I am facing same issue.