kreait / laravel-firebase

A Laravel package for the Firebase PHP Admin SDK

Home Page:https://github.com/kreait/firebase-php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change connection file on the fly

ayman-elmalah opened this issue · comments

When i changing the connection automated and update file credentials on the fly for each tenant

It return to me Unable to create the messaging service without a project ID

I need to change the connection on the fly for our clients using middleware and config set

That's a use case not supported by the package out of the box, but if you don't share how you are changing the connection on the fly, I'm not sure what you expect me to do here 😅. In general, it should work by using the factory directly

use Kreait\Firebase\Factory;

$factory = (new Factory)
    ->withServiceAccount($onTheFlyCredentials)
    ->withDatabaseUri('https://on-the-fly-rtdb.firebaseio.com');