kreait / laravel-firebase

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

Binding Error with 5.9 #222

Closed noeminihoul closed 5 days ago

noeminihoul commented 5 days ago

Describe the bug

Can't use facades with 5.9...

Have to remove this version and reinstall 5.8. With 5.8, no problem.

Installed packages

"laravel/framework": "^11.0",
"kreait/laravel-firebase": "5.9",

PHP version and extensions

php 8.2

Steps to reproduce the issue.

     $test=Firebase::auth();
      dd($test);

Error message/Stack trace

[2024-06-23 21:06:23] local.ERROR: Target class [firebase.manager] does not exist. {"userId":1,"exception":"[object] (Illuminate\\Contracts\\Container\\BindingResolutionException(code: 0): Target class [firebase.manager] does not exist. at /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php:906)
[stacktrace]
#0 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(787): Illuminate\\Container\\Container->build('firebase.manage...')
#1 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1030): Illuminate\\Container\\Container->resolve('firebase.manage...', Array, true)
#2 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(723): Illuminate\\Foundation\\Application->resolve('firebase.manage...', Array)
#3 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1015): Illuminate\\Container\\Container->make('firebase.manage...', Array)
#4 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(1446): Illuminate\\Foundation\\Application->make('firebase.manage...')
#5 /var/www/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(237): Illuminate\\Container\\Container->offsetGet('firebase.manage...')
#6 /var/www/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(208): Illuminate\\Support\\Facades\\Facade::resolveFacadeInstance('firebase.manage...')
#7 /var/www/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(351): Illuminate\\Support\\Facades\\Facade::getFacadeRoot()
...

Additional information

Thank you for your awesome work.

jeromegamez commented 5 days ago

You're quick! Thank you for the fast report. I'll revert the change and hope that the SDK Update alone fixes the issue in #210 🤞🏻

Apparently, I missed the "only" on https://laravel.com/docs/11.x/providers#deferred-providers even though it was emphasized 🤦🏼

jeromegamez commented 5 days ago

I reverted the change and released it as https://github.com/kreait/laravel-firebase/releases/tag/5.9.1

Thanks again! 🙏🏻