search

Home  >  Q&A  >  body text

Laravel Firebase authentication error, unresolved dependencies

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粉539055526P粉539055526247 days ago356

reply all(2)I'll reply

  • P粉170858678

    P粉1708586782024-03-29 21:45:15

    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';

    reply
    0
  • P粉964682904

    P粉9646829042024-03-29 18:26:37

    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.

    reply
    0
  • Cancelreply