skip to Main Content

I started with this project: https://github.com/suhasrkms/laravel-with-firebase-auth (I downloaded the zip for email/password auth). To duplicate issue I ran
composer require kreait/laravel-firebase:^4.0 -W
Updated from version kreait/laravel-firebase:^3.0 and I got this error.
Unresolvable dependency resolving [Parameter #0 [ string $projectId ]] in class KreaitFirebaseAuthApiClient

Originally I was trying to migrate this config to Laravel 10 with kreait/laravel-firebase:^5.1, however, for the life of me, I can’t see how to resolve this error. I have the config file loading in .env, I can use my firestore controller just fine. I was hoping to quickly get front end authentication going, but this error is halting progress.
I’m guessing a config changed between version 3 and 4.

2

Answers


  1. The kreait/laravel-firebase has updated the constructor.

    LoginController.php

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

    modify to this

    public function __construct() {
           $this->middleware('guest')->except('logout');
           $this->auth = app('firebase.auth';
    
    Login or Signup to reply.
  2. We must change the whole projects

    use KreaitFirebaseAuth;
    

    and replace it with

    use KreaitFirebaseContractAuth;
    

    And also the repository has been updated with the latest version refer bump to Laravel V10.9.0.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search