app->singleton(Database::class, function ($app) { $factory = (new Factory) ->withDatabaseUri(config('firebase.database_url')); // Jika menggunakan service account key file $serviceAccountPath = storage_path('app/firebase/service-account.json'); if (file_exists($serviceAccountPath)) { $factory = $factory->withServiceAccount($serviceAccountPath); } return $factory->createDatabase(); }); } /** * Bootstrap services. */ public function boot(): void { // } }