kreait / laravel-firebase

A Laravel package for the Firebase PHP Admin SDK
https://github.com/kreait/firebase-php
MIT License
992 stars 163 forks source link

Laravel 9.x support #121

Closed lukas-pierce closed 2 years ago

lukas-pierce commented 2 years ago

Not installed on Laravel 9

Composer error log:

$ composer require kreait/laravel-firebase

Using version ^4.1 for kreait/laravel-firebase
./composer.json has been updated
Running composer update kreait/laravel-firebase
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - google/auth v1.18.0 requires psr/cache ^1.0|^2.0 -> found psr/cache[1.0.0, 1.0.1, 2.0.0] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - kreait/laravel-firebase 4.1.0 requires kreait/firebase-php ^6.0 -> satisfiable by kreait/firebase-php[6.0.0, 6.0.1, 6.1.0, 6.x-dev].
    - kreait/firebase-php[6.0.0, ..., 6.x-dev] require google/auth ^1.18 -> satisfiable by google/auth[v1.18.0].
    - Root composer.json requires kreait/laravel-firebase ^4.1 -> satisfiable by kreait/laravel-firebase[4.1.0].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require kreait/laravel-firebase:*" to figure out if any version is installable, or "composer require kreait/laravel-firebase:^2.1" if you know which you need.

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

Seems like laravel uses psr/cache 3.0.0, but google/auth uses elder versions

jeromegamez commented 2 years ago

Laravel 9 doesn't require the psr/cache package on its own, only via the symfony/cache: ^6.0, which, in turn, supports psr/cache^2.0|^3.0`.

If you already have psr/cache 3.0 installed in your Laravel project, please try what the output above already suggests: composer update --with-all-dependencies or, if you want to install kreait/laravel-firebase for the first time: composer require --with-all-dependencies kreait/laravel-firebase.

As long as you don't have another library installed that only supports psr/cache 3.0, this should downgrade your local psr/cache to 2.x.