michaeldyrynda / laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models
MIT License
442 stars 46 forks source link

Laravel 11 compatibility #131

Open suhui666 opened 2 months ago

suhui666 commented 2 months ago

Your requirements could not be resolved to an installable set of packages.

Problem 1

You can also try re-running composer require with an explicit version constraint, e.g. "composer require dyrynda/laravel-model-uuid:*" to figure out if any version is installable, or "composer require dyrynda/laravel-model-uuid:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

intellent commented 2 months ago

I have the same issue.

I think the problem is that there is no official release since 09/23, although the most recent commits add Laravel 11 compatibility and include the merger of efficient-uuid package.

drbyte commented 2 months ago

Correct. Until a release is tagged, must use the 7.x-dev branch: composer require dyrynda/laravel-model-uuid:7.x-dev

suhui666 commented 2 months ago

正确的。在标记版本之前,必须使用 7.x-dev 分支: composer require dyrynda/laravel-model-uuid:7.x-dev

Thank you for your suggestion! However, I tried using the 7.x-dev branch method and found that it does not solve the issue encountered in Laravel 11. It seems that this problem requires a different solution. If you have any other suggestions or are aware of a specific solution that is suitable for Laravel 11, please share it with me. I greatly appreciate your help!

drbyte commented 2 months ago

I just tested it on PHP 8.2.16 using:

laravel new laravel11 to install a fresh Laravel 11 project. and then cd laravel11 composer require dyrynda/laravel-model-uuid:7.x-dev to install this package.

Composer installed correctly without errors.

suhui666 commented 2 months ago

I just tested it on PHP 8.2.16 using:

laravel new laravel11 to install a fresh Laravel 11 project. and then cd laravel11 composer require dyrynda/laravel-model-uuid:7.x-dev to install this package.

Composer installed correctly without errors.

Okay, it works now, but please note that this isn't a stable version. We're using a development branch, so while the immediate issue is resolved, it's important to be cautious and monitor for any updates or releases that provide a stable solution. Thank you for pointing me in the right direction!

drbyte commented 2 months ago

Actually, probably should use: 8.0.0-beta.1 composer require dyrynda/laravel-model-uuid:8.0.0-beta.1

(7.x-dev "works" because composer.json contains an alias for it, but they'll probably update that to 8.x-dev when 8.0 is officially released)