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

Change connection file on the fly #90

Closed ayman-elmalah closed 2 years ago

ayman-elmalah commented 3 years ago

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

jeromegamez commented 3 years ago

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