tpetry / laravel-postgresql-enhanced

Support for many missing PostgreSQL specific features
MIT License
777 stars 31 forks source link

Unable to install with Laravel 11.10.x #84

Closed coolamit closed 5 months ago

coolamit commented 5 months ago

I have a Laravel install (using 11.10.x) where I wanted to use PostgreSQL. I tried installing this package but it ran into the issue where composer couldn't install this package. It seemed like there was a conflict on the version of carbonphp/carbon-doctrine-types in use which gets installed by Laravel.

This is the output I got from composer.

vagrant@homestead:~/code/tmp-a$ composer require tpetry/laravel-postgresql-enhanced
./composer.json has been updated
Running composer update tpetry/laravel-postgresql-enhanced
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v11.13.0 requires nesbot/carbon ^2.72.2|^3.0 -> satisfiable by nesbot/carbon[3.6.0].
    - laravel/framework v11.13.0 requires symfony/http-foundation ^7.0 -> satisfiable by symfony/http-foundation[v7.1.1].
    - tpetry/laravel-postgresql-enhanced[0.1.0, ..., 0.5.0] require illuminate/database ^6.0|^7.0|^8.15 -> found illuminate/database[v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.15.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
    - tpetry/laravel-postgresql-enhanced[0.6.0, ..., 0.9.0] require illuminate/container ^6.0|^7.0|^8.0 -> found illuminate/container[v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
    - tpetry/laravel-postgresql-enhanced[0.10.0, ..., 0.25.1] require illuminate/container ^6.0|^7.0|^8.0|^9.0 -> found illuminate/container[v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require.
    - tpetry/laravel-postgresql-enhanced[0.26.0, ..., 0.36.0] require illuminate/container ^6.0|^7.0|^8.0|^9.0|^10.0 -> found illuminate/container[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.14] but these were not loaded, likely because it conflicts with another require.
    - doctrine/dbal[v2.6.0, ..., v2.9.3] require php ^7.1 -> your php version (8.3.1) does not satisfy that requirement.
    - doctrine/dbal[v2.10.0, ..., 2.10.4] require php ^7.2 -> your php version (8.3.1) does not satisfy that requirement.
    - doctrine/dbal[2.11.0, ..., 2.11.3] require php ^7.3 -> your php version (8.3.1) does not satisfy that requirement.
    - laravel/framework is locked to version v11.13.0 and an update of this package was not requested.
    - carbonphp/carbon-doctrine-types 3.2.0 conflicts with doctrine/dbal 3.8.6.
    - tpetry/laravel-postgresql-enhanced[0.37.0, ..., 0.39.0] require doctrine/dbal ^2.6|^3.5 -> satisfiable by doctrine/dbal[v2.6.0, ..., 2.13.9, 3.5.0, ..., 3.8.6].
    - nesbot/carbon 3.6.0 requires carbonphp/carbon-doctrine-types * -> satisfiable by carbonphp/carbon-doctrine-types[3.2.0].
    - symfony/http-foundation v7.1.1 conflicts with doctrine/dbal 3.5.4.
    - symfony/http-foundation v7.1.1 conflicts with doctrine/dbal 2.13.9.
    - symfony/http-foundation v7.1.1 conflicts with doctrine/dbal 2.13.8.
    - symfony/http-foundation v7.1.1 conflicts with doctrine/dbal 2.13.1.
    - symfony/http-foundation v7.1.1 conflicts with doctrine/dbal 2.12.1.
    - Root composer.json requires tpetry/laravel-postgresql-enhanced * -> satisfiable by tpetry/laravel-postgresql-enhanced[0.1.0, ..., 0.39.0].

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

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

I thought I'll try this out on a fresh install. So I created a new Laravel project (which installed 11.13.x). I ran into same issue. So I installed laravel-postgresql-enhanced package using the --with-all-dependencies flag using

composer require tpetry/laravel-postgresql-enhanced -W

And this installed the laravel-postgresql-enhanced package after it downgraded carbonphp/carbon-doctrine-types from 3.2.0 to 2.1.0.

vagrant@homestead:~/code/tmp-a$ composer require tpetry/laravel-postgresql-enhanced -W
./composer.json has been updated
Running composer update tpetry/laravel-postgresql-enhanced --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Lock file operations: 7 installs, 1 update, 0 removals
  - Downgrading carbonphp/carbon-doctrine-types (3.2.0 => 2.1.0)
  - Locking doctrine/cache (2.2.0)
  - Locking doctrine/dbal (3.8.6)
  - Locking doctrine/deprecations (1.1.3)
  - Locking doctrine/event-manager (2.0.1)
  - Locking psr/cache (3.0.0)
  - Locking spatie/regex (3.1.1)
  - Locking tpetry/laravel-postgresql-enhanced (0.39.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 7 installs, 1 update, 0 removals
  - Installing doctrine/cache (2.2.0): Extracting archive
  - Installing doctrine/deprecations (1.1.3): Extracting archive
  - Installing doctrine/event-manager (2.0.1): Extracting archive
  - Downgrading carbonphp/carbon-doctrine-types (3.2.0 => 2.1.0): Extracting archive
  - Installing psr/cache (3.0.0): Extracting archive
  - Installing spatie/regex (3.1.1): Extracting archive
  - Installing doctrine/dbal (3.8.6): Extracting archive
  - Installing tpetry/laravel-postgresql-enhanced (0.39.0): Extracting archive
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   INFO  Discovering packages.

  inertiajs/inertia-laravel ........................................................................................................ DONE
  laravel/breeze ................................................................................................................... DONE
  laravel/sail ..................................................................................................................... DONE
  laravel/sanctum .................................................................................................................. DONE
  laravel/tinker ................................................................................................................... DONE
  nesbot/carbon .................................................................................................................... DONE
  nunomaduro/collision ............................................................................................................. DONE
  nunomaduro/termwind .............................................................................................................. DONE
  tightenco/ziggy .................................................................................................................. DONE
  tpetry/laravel-postgresql-enhanced ............................................................................................... DONE

84 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.
Using version ^0.39.0 for tpetry/laravel-postgresql-enhanced

Thoughts? Is this just a matter of updating the dependency versions in the package's composer manifest?

tpetry commented 5 months ago

The problem was some weird behaviour of composer not wanting to downgrade Doctrine DBAL 4 to 3 which had been installed by some deep dependency of Laravel. Its fixed now with release 0.40.0 by also supporting DBAL 4.

coolamit commented 5 months ago

The problem was some weird behaviour of composer not wanting to downgrade Doctrine DBAL 4 to 3 which had been installed by some deep dependency of Laravel. Its fixed now with release 0.40.0 by also supporting DBAL 4.

Thanks @tpetry , much appreciated.