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

Laravel 9.x Compatibility

Open laravel-shift opened this issue 3 years ago • 24 comments

This is an automated pull request from Shift to update your package code and dependencies to be compatible with Laravel 9.x.

Before merging, you need to:

  • Checkout the l9-compatibility branch
  • Review all comments for additional changes
  • Thoroughly test your package

If you do find an issue, please report it by commenting on this PR to help improve future automation.

laravel-shift avatar Feb 03 '22 14:02 laravel-shift

:warning: The latest version of Laravel has a dependency for phpunit/phpunit of ^9.3. If you would like to also upgrade your tests, you may run the PHPUnit 9 Shift for free.

laravel-shift avatar Feb 03 '22 14:02 laravel-shift

:alembic: Using this package? If you would like to help test these changes or believe them to be compatible, you may update your project to reference this branch.

To do so, temporarily add Shift's fork to the repositories property of your composer.json:

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

Then update your dependency constraint to reference this branch:

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

Finally, run: composer update

laravel-shift avatar Feb 03 '22 14:02 laravel-shift

Also can confirm this is working as intended, would be nice to merge this ASAP.

olipayne avatar Feb 11 '22 18:02 olipayne

@grimzy any chance of getting this in? Thanks! :+1:

mattvb91 avatar Mar 02 '22 10:03 mattvb91

Does anyone have a maintained fork of this that I could switch to? Looks like this is is dead.

mattvb91 avatar Mar 21 '22 08:03 mattvb91

Is this going to get merged in anytime soon? @grimzy

matthewheck17 avatar Mar 31 '22 17:03 matthewheck17

Have a few projects I would love to update to Laravel 9. Is there something I/we can do to help git this committed @grimzy?

Also, for those needing to upgrade sooner than later, migrating to https://github.com/MatanYadaev/laravel-eloquent-spatial/ is relatively straight forward.

citricguy avatar Apr 05 '22 08:04 citricguy

@grimzy any chance of getting an ETA for this? I would prefer to stay with this but it looks like we need to migrate to another project

mattvb91 avatar Jun 21 '22 09:06 mattvb91

Bump for getting this merged

waustin avatar Jun 30 '22 14:06 waustin

Is there an ETA on merging this, or is it best to migrate to an alternate project / fork?

expansive-pcseik avatar Aug 18 '22 08:08 expansive-pcseik

@olipayne @SpiritSaint FYI We are facing this issue too, please provide an ETA. Also we are open to help if it is posible.

coronaJabu avatar Aug 30 '22 10:08 coronaJabu

Looks like this could be an alternative: https://github.com/MatanYadaev/laravel-eloquent-spatial

The API seems to cover most of it but I havent had a chance yet to implement: https://github.com/MatanYadaev/laravel-eloquent-spatial/blob/master/API.md

If anyone gets a chance to switch please report back as this is dead

EDIT: just noticed @citricguy had already discovered it!

mattvb91 avatar Sep 06 '22 19:09 mattvb91

I wasn't doing anything too complex to begin with, however the switch to https://github.com/MatanYadaev/laravel-eloquent-spatial was very straight forward.

No issues upgrading to Laravel 9x after moving over.

citricguy avatar Sep 06 '22 20:09 citricguy

I also ended up switching to https://github.com/MatanYadaev/laravel-eloquent-spatial and it wasn't too hard

matthewheck17 avatar Sep 06 '22 21:09 matthewheck17

@matthewheck17 @citricguy @mattvb91

I am trying it with a fresh new project with Laravel 9.x.

I will report here if that works fine.

tomavic avatar Oct 06 '22 19:10 tomavic

The l9-compatibility was made to work with what MySql version? MySql 8?

QSoto avatar Nov 02 '22 17:11 QSoto

After updating to this version, I get Incorrect parameter count in the call to native function 'ST_GeomFromText' when using distanceSphere()...

mwargan avatar Dec 05 '22 13:12 mwargan

After updating to this version, I get Incorrect parameter count in the call to native function 'ST_GeomFromText' when using distanceSphere()...

I faced the same issue. After long research, it looked like a MySQL 8 bug. I ended up using a plain distance calculation

QSoto avatar Dec 05 '22 15:12 QSoto

For people trying to get this working with Laravel 10, I've created a fork with the dependencies bumped.

{
    "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 22:03 joshbaumann

@grimzy would it be possible to get this in?

HiradRoshandel avatar May 01 '23 23:05 HiradRoshandel

@aconital I highly recommend switching to https://github.com/MatanYadaev/laravel-eloquent-spatial

The switch was simple.

In my case it involved:

  • switching to a new trait
  • using the built in cast instead of $spatialFields
  • using properties instead of methods ie ->latitude instead of ->getLat() on the geo objects.

It took 20 minutes.

patrickomeara avatar May 01 '23 23:05 patrickomeara

Same here, transition was quick and hasn't given me any issues at all.

citricguy avatar May 01 '23 23:05 citricguy

@aconital I highly recommend switching to https://github.com/MatanYadaev/laravel-eloquent-spatial

The switch was simple.

In my case it involved:

  • switching to a new trait
  • using the built in cast instead of $spatialFields
  • using properties instead of methods ie ->latitude instead of ->getLat() on the geo objects.

It took 20 minutes.

Thank you I'll give it a try

HiradRoshandel avatar May 01 '23 23:05 HiradRoshandel

@citricguy thanks for the initial recommendation!

patrickomeara avatar May 01 '23 23:05 patrickomeara