Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to override FirestoreClient::DEFAULT_DATABASE #205

Closed
mcadet opened this issue Nov 3, 2023 · 7 comments · Fixed by micronotes-dev/laravel-firebase#1
Closed

Be able to override FirestoreClient::DEFAULT_DATABASE #205

mcadet opened this issue Nov 3, 2023 · 7 comments · Fixed by micronotes-dev/laravel-firebase#1
Assignees

Comments

@mcadet
Copy link

mcadet commented Nov 3, 2023

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:

  • laravel/framework : v10.28.0
  • kreait/laravel-firebase : v5.4.0
  • google/cloud-firestore : v1.37.3
@jeromegamez
Copy link
Member

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:

  • Enable the factory to accept Firestore client options
  • Merge them with the default client options (they define the authentication config)
  • Make the options configurable here in the package and pass them to the factory

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

@mcadet
Copy link
Author

mcadet commented Dec 28, 2023

Oh thank you very much @jeromegamez! Awesome!

@mcadet mcadet closed this as completed Dec 28, 2023
@jeromegamez
Copy link
Member

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

@jeromegamez jeromegamez reopened this Dec 28, 2023
@mcadet
Copy link
Author

mcadet commented Dec 28, 2023

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

I just realized it 😫

@mcadet
Copy link
Author

mcadet commented Jan 12, 2024

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
Copy link
Member

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
Copy link
Author

mcadet commented Jan 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants