fix firebase provider

This commit is contained in:
Vckynando12 2025-02-19 06:19:02 +07:00
parent bd9fe33923
commit aa1aa58ffc
1 changed files with 5 additions and 5 deletions

View File

@ -13,16 +13,16 @@ public function register()
{ {
$this->app->singleton(FirebaseAuth::class, function ($app) { $this->app->singleton(FirebaseAuth::class, function ($app) {
$factory = (new Factory) $factory = (new Factory)
->withServiceAccount(storage_path('app/smartcab-8bb42-firebase-adminsdk-fbsvc-de33a8e45b.json')) ->withServiceAccount(json_decode(env('FIREBASE_CREDENTIALS'), true))
->withDatabaseUri(env('FIREBASE_DATABASE_URL')); ->withDatabaseUri(env('FIREBASE_DATABASE_URL'));
return $factory->createAuth(); return $factory->createAuth();
}); });
$this->app->singleton(Database::class, function ($app) { $this->app->singleton(Database::class, function ($app) {
$factory = (new Factory) $factory = (new Factory)
->withServiceAccount(storage_path('app/smartcab-8bb42-firebase-adminsdk-fbsvc-de33a8e45b.json')) ->withServiceAccount(config('firebase.credentials'))
->withDatabaseUri(env('FIREBASE_DATABASE_URL')); ->withDatabaseUri(config('firebase.database_url'));
return $factory->createDatabase(); return $factory->createDatabase();
}); });
@ -32,4 +32,4 @@ public function boot()
{ {
// //
} }
} }