kreait / laravel-firebase

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

Not compatible with Laravel 10.x #177

Closed codoffer closed 1 year ago

codoffer commented 1 year ago

Describe the bug

Not able to install this package with laravel 10.x. Getting below error on installation

Installed packages

"require": {
        "php": "^8.1",
        "guzzlehttp/guzzle": "^7.2",
        "laravel/framework": "^10.8",
        "laravel/sanctum": "^3.2",
        "laravel/tinker": "^2.8"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "laravel/pint": "^1.0",
        "laravel/sail": "^1.18",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^7.0",
        "phpunit/phpunit": "^10.1",
        "spatie/laravel-ignition": "^2.0"
    },

PHP version and extensions

composer               2.3.7    Composer package
composer-plugin-api    2.3.0    The Composer Plugin API
composer-runtime-api   2.2.2    The Composer Runtime API
ext-bcmath             8.2.5    The bcmath PHP extension
ext-bz2                8.2.5    The bz2 PHP extension
ext-calendar           8.2.5    The calendar PHP extension
ext-ctype              8.2.5    The ctype PHP extension
ext-curl               8.2.5    The curl PHP extension
ext-date               8.2.5    The date PHP extension
ext-dba                8.2.5    The dba PHP extension
ext-dom                20031129 The dom PHP extension
ext-exif               8.2.5    The exif PHP extension
ext-ffi                8.2.5    The FFI PHP extension
ext-fileinfo           8.2.5    The fileinfo PHP extension
ext-filter             8.2.5    The filter PHP extension
ext-ftp                8.2.5    The ftp PHP extension
ext-gd                 8.2.5    The gd PHP extension
ext-gettext            8.2.5    The gettext PHP extension
ext-gmp                8.2.5    The gmp PHP extension
ext-hash               8.2.5    The hash PHP extension
ext-iconv              8.2.5    The iconv PHP extension
ext-intl               8.2.5    The intl PHP extension
ext-json               8.2.5    The json PHP extension
ext-ldap               8.2.5    The ldap PHP extension
ext-libxml             8.2.5    The libxml PHP extension
ext-mbstring           8.2.5    The mbstring PHP extension
ext-mysqli             8.2.5    The mysqli PHP extension
ext-mysqlnd            0        The mysqlnd PHP extension (actual version: mysqlnd 8.2.5)
ext-odbc               8.2.5    The odbc PHP extension
ext-openssl            8.2.5    The openssl PHP extension
ext-pcntl              8.2.5    The pcntl PHP extension
ext-pcre               8.2.5    The pcre PHP extension
ext-pdo                8.2.5    The PDO PHP extension
ext-pdo_dblib          8.2.5    The pdo_dblib PHP extension
ext-pdo_mysql          8.2.5    The pdo_mysql PHP extension
ext-pdo_odbc           8.2.5    The PDO_ODBC PHP extension
ext-pdo_pgsql          8.2.5    The pdo_pgsql PHP extension
ext-pdo_sqlite         8.2.5    The pdo_sqlite PHP extension
ext-pgsql              8.2.5    The pgsql PHP extension
ext-phar               8.2.5    The Phar PHP extension
ext-posix              8.2.5    The posix PHP extension
ext-pspell             8.2.5    The pspell PHP extension
ext-random             8.2.5    The random PHP extension
ext-readline           8.2.5    The readline PHP extension
ext-reflection         8.2.5    The Reflection PHP extension
ext-session            8.2.5    The session PHP extension
ext-shmop              8.2.5    The shmop PHP extension
ext-simplexml          8.2.5    The SimpleXML PHP extension
ext-soap               8.2.5    The soap PHP extension
ext-sockets            8.2.5    The sockets PHP extension
ext-sodium             8.2.5    The sodium PHP extension
ext-spl                8.2.5    The SPL PHP extension
ext-sqlite3            8.2.5    The sqlite3 PHP extension
ext-sysvmsg            8.2.5    The sysvmsg PHP extension
ext-sysvsem            8.2.5    The sysvsem PHP extension
ext-sysvshm            8.2.5    The sysvshm PHP extension
ext-tidy               8.2.5    The tidy PHP extension
ext-tokenizer          8.2.5    The tokenizer PHP extension
ext-xml                8.2.5    The xml PHP extension
ext-xmlreader          8.2.5    The xmlreader PHP extension
ext-xmlwriter          8.2.5    The xmlwriter PHP extension
ext-xsl                8.2.5    The xsl PHP extension
ext-zend-opcache       8.2.5    The Zend OPcache PHP extension
ext-zip                1.21.1   The zip PHP extension
ext-zlib               8.2.5    The zlib PHP extension
lib-bz2                1.0.8    The bz2 library
lib-curl               8.0.1    The curl library
lib-curl-libssh2       1.10.0   curl libssh2 version
lib-curl-zlib          1.2.11   curl zlib version
lib-date-timelib       2022.05  date timelib version
lib-date-zoneinfo      2023.2   zoneinfo ("Olson") database for date
lib-fileinfo-libmagic  540      fileinfo libmagic version
lib-gd                 2.3.3    The gd library
lib-gmp                6.2.1    The gmp library
lib-icu                72.1     The ICU unicode and globalization support library
lib-icu-cldr           42       ICU CLDR project version
lib-icu-unicode        15.0.0   ICU unicode version
lib-ldap-openldap      2.6.4    OpenLDAP version of ldap
lib-libsodium          1.0.18   The libsodium library
lib-libxml             2.9.13   libxml library version
lib-libxslt            1.1.35   The libxslt library
lib-libxslt-libxml     2.9.13   libxml version libxslt is compiled against
lib-mbstring-libmbfl   1.3.2    mbstring libmbfl version
lib-mbstring-oniguruma 6.9.8    mbstring oniguruma version
lib-openssl            1.1.1.20 OpenSSL 1.1.1t  7 Feb 2023
lib-pcre               10.42    The pcre library
lib-pcre-unicode       14.0.0   PCRE Unicode version support
lib-pdo_pgsql-libpq    15.2     libpq for pdo_pgsql
lib-pdo_sqlite-sqlite  3.41.2   The pdo_sqlite-sqlite library
lib-sqlite3-sqlite     3.41.2   The sqlite3-sqlite library
lib-zip-libzip         1.9.2    The zip-libzip library
lib-zlib               1.2.11   The zlib library
php                    8.2.5    The PHP interpreter
php-64bit              8.2.5    The PHP interpreter, 64bit
php-ipv6               8.2.5    The PHP interpreter, with IPv6 support

Steps to reproduce the issue.

# Insert the commands issued in the terminal if they are needed
# to reproduce the issue. Otherwise, delete this code block.
// Insert the PHP code to reproduce the issue. Please ensure that it is code that
// can be copy pasted to reproduce it.

composer require kreait/laravel-firebase

Error message/Stack trace

Problem 1
    - kreait/firebase-php[7.0.0, ..., 7.2.1] require psr/http-message ^1.0.1 -> found psr/http-message[1.0.1, 1.1] but the package is fixed to 2.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 5.2.0 requires kreait/firebase-php ^7.0 -> satisfiable by kreait/firebase-php[7.0.0, ..., 7.2.1].
    - Root composer.json requires kreait/laravel-firebase ^5.2 -> satisfiable by kreait/laravel-firebase[5.2.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.

Additional information

No response

jeromegamez commented 1 year ago

This is not a Laravel issue - the SDK needs to be updated to allow psr/message 2.x, but Laravel supports both.

Using --with-all-dependencies (as suggested by the output above) should help as long as you don't have another package that specifically requires psr/message 2.x and doesn't support 1.x.

jeromegamez commented 1 year ago

I just checked - the installation of psr/http-message 2.x needs the release of https://github.com/googleapis/google-auth-library-php/pull/449 and an update of google/cloud-core to use the updated google/auth dependency (related: https://github.com/googleapis/google-cloud-php/pull/6029).

Until then, the SDK will be ready to support it as well.

Again, installing the Laravel Package with composer require kreait/laravel-firebase --with-all-dependencies should work.