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

Be able to override FirestoreClient::DEFAULT_DATABASE #205

Closed mcadet closed 5 months ago

mcadet commented 7 months ago

Describe the feature you would like to see

As described in https://cloud.google.com/firestore/docs/manage-databases?hl=fr#create_a_database, I would like to be able to override the constant defined in FirestoreClient named DEFAULT_DATABASE.

The goal will be to allow defining it via the configuration file.

My application uses multi-tenancy, and I want to switch the configuration while bootstrapping or reverting the tenancy.

I thought I just had to extend the Factory class (impossible because it's final), or whatever, but I couldn't accomplish this. Maybe is it another way to do this?

Thank you for your awesome work in this package.

Used versions:

jeromegamez commented 7 months ago

At the moment, the Firestore (and Cloud Storage) component are just super simple bridges, allowing them to be configured with options, as setting the default database) would be a good addition, thank you for bringing it up!

Todo list for myself:

I only have limited time available, so I can't give you an ETA, but it's on my radar.

mcadet commented 6 months ago

Oh thank you very much @jeromegamez! Awesome!

jeromegamez commented 6 months ago

I didn't do it in the Laravel package yet 😅🙈

mcadet commented 6 months ago

I didn't do it in the Laravel package yet 😅🙈

I just realized it 😫

mcadet commented 5 months ago

Happy New Year @jeromegamez!

I would like to know if any update will be done about this issue in the current month? If not, I probably will fork the project for my personal use with database override, as it's required for my business.

Thank you very much!

jeromegamez commented 5 months ago

Since my work on my Firebase projects isn't funded (you've probably seen it in the readme of the SDK repo), I'm not motivated to do more than keeping everything stable and working at the moment, so I can't give you an ETA.

I understand you need it for your business and to make money, so for the moment I'd recommend forking the package and changing what you need - perhaps you'll do it in a way that can be merged back into here.

mcadet commented 5 months ago

Since my work on my Firebase projects isn't funded (you've probably seen it in the readme of the SDK repo), I'm not motivated to do more than keeping everything stable and working at the moment, so I can't give you an ETA.

I understand you need it for your business and to make money, so for the moment I'd recommend forking the package and changing what you need - perhaps you'll do it in a way that can be merged back into here.

I understand. I will fork it so.