baopham / laravel-dynamodb

Eloquent syntax for DynamoDB
https://packagist.org/packages/baopham/dynamodb
MIT License
490 stars 127 forks source link

Laravel 11 support #279

Closed matthew-hallsworth closed 5 months ago

matthew-hallsworth commented 6 months ago

Hello!

I've tried to upgrade my existing L10 install that uses this library for interaction with DynamoDB, but the version constraints fail. I expect that this is because there's a new version of illuminate/database that hasn't been handled yet for this lib.

composer.json:

"require": {
        "php": "^8.3",
        "aws/aws-sdk-php": "^3.300",
        "baopham/dynamodb": "^6.4",
        "guzzlehttp/guzzle": "^7.2",
        "jigarakatidus/laravel-http-to-curl": "^1.0",
        "laravel/framework": "^11.0",
        "laravel/sanctum": "^4.0",
        "laravel/tinker": "^2.8"
    },

Output from composer update is the following:

Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - illuminate/database[v5.6.0, ..., v5.8.36] require php ^7.1.3 -> your php version (8.3.3) does not satisfy that requirement.
    - illuminate/database[v6.0.0, ..., v6.19.1] require php ^7.2 -> your php version (8.3.3) does not satisfy that requirement.
    - illuminate/database[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.3.3) does not satisfy that requirement.
    - illuminate/database[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.3.3) does not satisfy that requirement.
    - Root composer.json requires baopham/dynamodb ^6.4 -> satisfiable by baopham/dynamodb[6.4.0].
    - Conclusion: don't install laravel/framework v11.0.2 (conflict analysis result)
    - Conclusion: don't install laravel/framework v11.0.3 (conflict analysis result)
    - Conclusion: don't install laravel/framework v11.0.1 (conflict analysis result)
    - baopham/dynamodb 6.4.0 requires illuminate/database 5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0|^10.0 -> satisfiable by illuminate/database[v5.1.1, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.16, v10.0.0, ..., v10.48.2].
    - Only one of these can be installed: illuminate/database[v5.1.1, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.16, v10.0.0, ..., v10.48.2, v11.0.0, v11.0.1, v11.0.2, v11.0.3], laravel/framework[v11.0.0, v11.0.1, v11.0.2, v11.0.3]. laravel/framework replaces illuminate/database and thus cannot coexist with it.
    - Root composer.json requires laravel/framework ^11.0 -> satisfiable by laravel/framework[v11.0.0, v11.0.1, v11.0.2, v11.0.3].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Thanks!

nelson6e65 commented 6 months ago

Fixed by @thebatclaudio in #282

Until next release, you can use the dev-master version in the meantime, @matthew-hallsworth.

matthew-hallsworth commented 6 months ago

Using dev-master works but we are limited to framework version 11.0. If you try to upgrade to 11.2 which is the current, composer throws more problems. The requirements of laravel-dynamodb on the framework version seems to be too restrictive.

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

  Problem 1
    - illuminate/database[v5.6.0, ..., 5.8.x-dev] require php ^7.1.3 -> your php version (8.3.4) does not satisfy that requirement.
    - illuminate/database[v6.0.0, ..., v6.19.1] require php ^7.2 -> your php version (8.3.4) does not satisfy that requirement.
    - illuminate/database[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.3.4) does not satisfy that requirement.
    - illuminate/database[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.3.4) does not satisfy that requirement.
    - Root composer.json requires baopham/dynamodb dev-master -> satisfiable by baopham/dynamodb[dev-master].
    - Conclusion: don't install laravel/framework v11.2.0 (conflict analysis result)
    - baopham/dynamodb dev-master requires illuminate/database 5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0| ^10.0 || v11.0 -> satisfiable by illuminate/database[v5.1.1, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev, v10.0.0, ..., 10.x-dev, v11.0.0].
    - Only one of these can be installed: illuminate/database[v5.1.1, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev, v10.0.0, ..., 10.x-dev, v11.0.0, ..., 11.x-dev], laravel/framework[v11.2.0, 11.x-dev]. laravel/framework replaces illuminate/database and thus cannot coexist with it.
    - Root composer.json requires laravel/framework ^11.2 -> satisfiable by laravel/framework[v11.2.0, 11.x-dev].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
nelson6e65 commented 5 months ago

Hmm… ^11.0 constraint it should be compatible with any minor version (11.1, 11.2, 11.x).

Seems to be a problem with illuminate/database. But, it is supposed laravel/framework takes care of it.

nelson6e65 commented 5 months ago

https://github.com/laravel/framework/blob/11.x/composer.json#L73

nelson6e65 commented 5 months ago

@matthew-hallsworth Have you tried including -W?:

composer remove baopham/dynamodb

composer require baopham/dynamodb:dev-master -W
matthew-hallsworth commented 5 months ago

@nelson6e65

Did so, here's the output

composer remove baopham/dynamodb
./composer.json has been updated
Running composer update baopham/dynamodb
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 0 updates, 1 removal
  - Removing baopham/dynamodb (dev-master ee527b0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 0 updates, 1 removal
  - Removing baopham/dynamodb (dev-master ee527b0)
Generating optimized autoload files

Then

composer update
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 4 updates, 0 removals
  - Upgrading aws/aws-sdk-php (3.304.2 => 3.304.4)
  - Upgrading laravel/framework (v11.0.0 => v11.3.1)
  - Upgrading mockery/mockery (1.6.7 => 1.6.11)
  - Upgrading monolog/monolog (3.5.0 => 3.6.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 4 updates, 0 removals
  - Downloading monolog/monolog (3.6.0)
  - Downloading laravel/framework (v11.3.1)
  - Downloading aws/aws-sdk-php (3.304.4)
  - Upgrading monolog/monolog (3.5.0 => 3.6.0): Extracting archive
  - Upgrading laravel/framework (v11.0.0 => v11.3.1): Extracting archive
  - Upgrading aws/aws-sdk-php (3.304.2 => 3.304.4): Extracting archive
  - Upgrading mockery/mockery (1.6.7 => 1.6.11): Extracting archive
Generating optimized autoload files

Finally

composer require baopham/dynamodb:dev-master -W
./composer.json has been updated
Running composer update baopham/dynamodb --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires baopham/dynamodb dev-master -> satisfiable by baopham/dynamodb[dev-master].
    - Only one of these can be installed: laravel/framework[v11.0.0, ..., 11.x-dev], illuminate/database[v11.0.0, v11.3.1]. laravel/framework replaces illuminate/database and thus cannot coexist with it.
    - baopham/dynamodb dev-master requires illuminate/database 5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0| ^10.0 || v11.0 -> satisfiable by illuminate/database[v5.1.1, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev, v10.0.0, ..., 10.x-dev, v11.0.0], laravel/framework[v11.0.0].
    - laravel/framework v11.0.0 conflicts with mockery/mockery >=1.6.8.
    - mockery/mockery is locked to version 1.6.11 and an update of this package was not requested.
    - Root composer.json requires laravel/framework ^11.0 -> satisfiable by laravel/framework[v11.0.0, ..., 11.x-dev].

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

Once I locked mockery/mockery to <=1.6.8 we had success again but it's still downgraded the framework to 11.0.0

composer require baopham/dynamodb:dev-master -W
./composer.json has been updated
Running composer update baopham/dynamodb --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 1 update, 0 removals
  - Locking baopham/dynamodb (dev-master ee527b0)
  - Downgrading laravel/framework (v11.3.1 => v11.0.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 1 update, 0 removals
  - Downgrading laravel/framework (v11.3.1 => v11.0.0): Extracting archive
  - Installing baopham/dynamodb (dev-master ee527b0): Extracting archive
Generating optimized autoload files
nelson6e65 commented 5 months ago
sail@65b33006c0e8:/var/www/html$ php artisan --version
Laravel Framework 11.3.1
sail@65b33006c0e8:/var/www/html$ php --version
PHP 8.3.6 (cli) (built: Apr 11 2024 20:23:38) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.6, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.6, Copyright (c), by Zend Technologies
    with Xdebug v3.3.1, Copyright (c) 2002-2023, by Derick Rethans
I'm having the same problem. ```shell sail@65b33006c0e8:/var/www/html$ composer require baopham/dynamodb:dev-master -W Composer could not detect the root package (laravel/laravel) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version ./composer.json has been updated Composer could not detect the root package (laravel/laravel) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version Running composer update baopham/dynamodb --with-all-dependencies Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - illuminate/database[v5.1.1, ..., v5.1.41] require illuminate/contracts 5.1.* -> found illuminate/contracts[v5.1.1, ..., v5.1.41] but these were not loaded, likely because it conflicts with another require. - illuminate/database[v5.2.0, ..., v5.2.45] require illuminate/contracts 5.2.* -> found illuminate/contracts[v5.2.0, ..., v5.2.45] but these were not loaded, likely because it conflicts with another require. - illuminate/database[v5.3.0, ..., v5.3.23] require illuminate/contracts 5.3.* -> found illuminate/contracts[v5.3.0, v5.3.4, v5.3.16, v5.3.23] but these were not loaded, likely because it conflicts with another require. - illuminate/database[v5.4.0, ..., v5.4.36] require illuminate/contracts 5.4.* -> found illuminate/contracts[v5.4.0, ..., v5.4.36] but these were not loaded, likely because it conflicts with another require. - illuminate/database[v5.5.0, ..., v5.5.44] require illuminate/contracts 5.5.* -> found illuminate/contracts[v5.5.0, ..., v5.5.44] but these were not loaded, likely because it conflicts with another require. - illuminate/database[v5.6.0, ..., v5.8.36] require php ^7.1.3 -> your php version (8.3.6) does not satisfy that requirement. - illuminate/database[v6.0.0, ..., v6.19.1] require php ^7.2 -> your php version (8.3.6) does not satisfy that requirement. - illuminate/database[v6.20.0, ..., v6.20.44] require illuminate/contracts ^6.0 -> found illuminate/contracts[v6.0.0, ..., v6.20.44] but these were not loaded, likely because it conflicts with another require. - illuminate/database[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.3.6) does not satisfy that requirement. - illuminate/database[v7.29.0, ..., v7.30.6] require illuminate/contracts ^7.0 -> found illuminate/contracts[v7.0.0, ..., v7.30.6] but these were not loaded, likely because it conflicts with another require. - illuminate/database[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.3.6) does not satisfy that requirement. - illuminate/database[v8.12.0, ..., v8.83.27] require illuminate/contracts ^8.0 -> found illuminate/contracts[v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require. - illuminate/database[v9.0.0, ..., v9.52.16] require illuminate/support ^9.0 -> found illuminate/support[v9.0.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require. - Root composer.json requires baopham/dynamodb dev-master -> satisfiable by baopham/dynamodb[dev-master]. - Conclusion: don't install laravel/framework v11.0.3 (conflict analysis result) - Conclusion: don't install laravel/framework v11.0.4 (conflict analysis result) - Conclusion: don't install laravel/framework v11.0.5 (conflict analysis result) - Conclusion: don't install laravel/framework v11.0.6 (conflict analysis result) - Conclusion: don't install laravel/framework v11.0.7 (conflict analysis result) - Conclusion: don't install laravel/framework v11.0.8 (conflict analysis result) - Conclusion: don't install laravel/framework v11.1.0 (conflict analysis result) - Conclusion: don't install laravel/framework v11.1.1 (conflict analysis result) - Conclusion: don't install laravel/framework v11.2.0 (conflict analysis result) - Conclusion: don't install laravel/framework v11.3.0 (conflict analysis result) - Conclusion: don't install laravel/framework v11.3.1 (conflict analysis result) - laravel/framework v11.0.0 conflicts with mockery/mockery >=1.6.8. - mockery/mockery is locked to version 1.6.11 and an update of this package was not requested. - Conclusion: don't install laravel/framework v11.0.2 (conflict analysis result) - baopham/dynamodb dev-master requires illuminate/database 5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0| ^10.0 || v11.0 -> satisfiable by laravel/framework[v11.0.0], illuminate/database[v5.1.1, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.16, v10.0.0, ..., v10.48.7, v11.0.0]. - Only one of these can be installed: illuminate/database[v5.1.1, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.16, v10.0.0, ..., v10.48.7, v11.0.0], laravel/framework[v11.0.0, ..., v11.3.1]. laravel/framework replaces illuminate/database and thus cannot coexist with it. - Root composer.json requires laravel/framework ^11.0 -> satisfiable by laravel/framework[v11.0.0, ..., v11.3.1]. Installation failed, reverting ./composer.json and ./composer.lock to their original content. ```

I'll check in a clean Laravel 11 project.

nelson6e65 commented 5 months ago

@matthew-hallsworth I found the problem. It was a typo in the version constraint 😆

nelson6e65 commented 5 months ago

Use ^6.5.0 🚀

nelson6e65 commented 5 months ago

Remember, this release is not tested for full Laravel 11 compatibility, it just allows you to install it. Check your use case and report any bug you found.

matthew-hallsworth commented 5 months ago
composer update
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 2 updates, 0 removals
  - Upgrading baopham/dynamodb (dev-master ee527b0 => dev-master 1ed8090)
  - Upgrading laravel/framework (v11.0.0 => v11.3.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals
  - Downloading baopham/dynamodb (dev-master 1ed8090)
  - Upgrading laravel/framework (v11.0.0 => v11.3.1): Extracting archive
  - Upgrading baopham/dynamodb (dev-master ee527b0 => dev-master 1ed8090): Extracting archive
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   INFO  Discovering packages.

  baopham/dynamodb ............................................................................................................................ DONE
  laravel/sail ................................................................................................................................ DONE
  laravel/sanctum ............................................................................................................................. DONE
  laravel/tinker .............................................................................................................................. DONE
  nesbot/carbon ............................................................................................................................... DONE
  nunomaduro/collision ........................................................................................................................ DONE
  nunomaduro/termwind ......................................................................................................................... DONE
  spatie/laravel-ignition ..................................................................................................................... DONE

93 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> @php artisan vendor:publish --tag=laravel-assets --ansi --force

   INFO  No publishable resources for tag [laravel-assets].

No security vulnerability advisories found.

Nice one :) I will test and report back any bugs. Thanks for your support on this tedious issue!

nelson6e65 commented 5 months ago

You should use ^6.5.0 version instead of dev-master now. I'll add some experimental features, and it may break something in your particular case.