diff --git a/app/Providers/FirebaseServiceProvider.php b/app/Providers/FirebaseServiceProvider.php index 7884b1a..736a2fa 100644 --- a/app/Providers/FirebaseServiceProvider.php +++ b/app/Providers/FirebaseServiceProvider.php @@ -13,16 +13,16 @@ public function register() { $this->app->singleton(FirebaseAuth::class, function ($app) { $factory = (new Factory) - ->withServiceAccount(storage_path('app/smartcab-8bb42-firebase-adminsdk-fbsvc-de33a8e45b.json')) - ->withDatabaseUri(env('FIREBASE_DATABASE_URL')); + ->withServiceAccount(json_decode(env('FIREBASE_CREDENTIALS'), true)) + ->withDatabaseUri(env('FIREBASE_DATABASE_URL')); return $factory->createAuth(); }); $this->app->singleton(Database::class, function ($app) { $factory = (new Factory) - ->withServiceAccount(storage_path('app/smartcab-8bb42-firebase-adminsdk-fbsvc-de33a8e45b.json')) - ->withDatabaseUri(env('FIREBASE_DATABASE_URL')); + ->withServiceAccount(config('firebase.credentials')) + ->withDatabaseUri(config('firebase.database_url')); return $factory->createDatabase(); }); @@ -32,4 +32,4 @@ public function boot() { // } -} +} \ No newline at end of file