laravel-mysql-spatial icon indicating copy to clipboard operation
laravel-mysql-spatial copied to clipboard

Laravel 10

Open swus13 opened this issue 2 years ago • 3 comments

Is the project dead?

Is there a way to use this package also in Laravel 10 via composer?

swus13 avatar Mar 04 '23 16:03 swus13

@swus13 I've got this working in my Laravel 10 app. I am only using the Point class and the distanceSphere query method, but these are at least working for me.

Can reference my fork:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/joshbaumann/laravel-mysql-spatial.git"
        }
    ]
}

Then update your dependency constraint to reference this branch:

{
    "require": {
        "grimzy/laravel-mysql-spatial": "dev-l10-compatibility",
    }
}

Finally, run: composer update

joshbaumann avatar Mar 06 '23 23:03 joshbaumann

@joshbaumann

thanks for that, unfortunately it doesn't work for me. For polygon and point I get the following errors now.

Exception: Unknown database type polygon requested, Doctrine\DBAL\Platforms\MySQL80Platform may not support it. Exception: Unknown database type point requested, Doctrine\DBAL\Platforms\MySQL80Platform may not support it.

on this artisan call: php artisan ide-helper:models -W

swus13 avatar Mar 07 '23 07:03 swus13

Thanks @joshbaumann . I was upgrading an existing project taken from internet so i even dont have an idea how that package can be replaced with laravel 10 compatible alternatives. But with your repo, it just worked. Getting some warnings on debugbar but yet no exceptions. I am going to test if the project is still fully functionable.

Otajonov avatar Jun 07 '23 14:06 Otajonov