Laravel Firebase authentication error, unresolved dependencies
P粉539055526
P粉539055526 2024-03-29 00:09:04
0
2
361

I started with this project: https://github.com/suhasrkms/laravel-with-firebase-auth (I downloaded the zip for email/password authentication). To duplicate the problem I ran Composer requires kreait/laravel-firebase:^4.0 -W Updated from version kreait/laravel-firebase:^3.0 I get this error. Resolving [parameter #0 [ string $projectId ]] unresolved dependency in class Kreait\Firebase\Auth\ApiClient

Initially I tried to migrate this configuration to Laravel 10 using kreait/laravel-firebase:^5.1, however, for the life of me I don't know how to resolve this error. I've loaded the config file in .env and I can use my firestore controller just fine. I'd like to be able to do front-end authentication quickly, but this error is blocking progress. I'm guessing the configuration changed between version 3 and 4.

P粉539055526
P粉539055526

reply all(2)
P粉170858678

kreait/laravel-firebase Constructor updated.

LoginController.php

public function __construct(FirebaseAuth $auth) {
       $this->middleware('guest')->except('logout');
       $this->auth = $auth;

Changed to this

public function __construct() {
       $this->middleware('guest')->except('logout');
       $this->auth = app('firebase.auth';
P粉964682904

We have to change the entire project

use Kreait\Firebase\Auth;

and replace it with

use Kreait\Firebase\Contract\Auth;

And the repository has been updated to the latest version, see Bump to Laravel V10.9.0.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template