kreait/laravel-firebase
Laravel integration for the Firebase PHP Admin SDK. Configure via FIREBASE_ env vars using a service account JSON or array credentials, then access Firebase services in your app. Supports multiple Firebase projects and common Laravel workflows.
Pros:
Firebase), reducing boilerplate.Cons:
firebase-php SDK, which may limit customization for edge cases (e.g., non-standard Firebase API usage).High:
kreait/laravel-firebase) and a single vendor:publish command for configuration..env, simplifying CI/CD pipelines (e.g., GitHub Actions, Kubernetes secrets).Firebase::auth(), Firebase::storage()) that mirrors Laravel’s Eloquent patterns, reducing learning curves.firebase-php SDK (v8.x) supports all Firebase services (Auth, Firestore, Realtime DB, Storage, etc.), ensuring feature parity.Potential Challenges:
FIREBASE_CREDENTIALS=path/to/file.json).symfony/cache TTL).Low to Medium:
firebase-php SDK is actively maintained (last release: 2026-05-07), with clear deprecation policies.Firebase::project('app')->auth()).http_debug_log_channel) can impact performance in production; should be disabled or routed to a dedicated channel.Mitigation Strategies:
Mockery).spatie/laravel-activitylog for auditing).Use Case Alignment:
Performance Requirements:
Security Compliance:
Team Expertise:
Future-Proofing:
Laravel Ecosystem:
vendor:publish).symfony/cache (v7/8) for token caching, which is compatible with Laravel’s service container.Non-Laravel Considerations:
Factory (though this is discouraged per the README).firebase-php can be used directly if Laravel-specific features (e.g., facades) are not needed.Greenfield Projects:
php artisan vendor:publish --provider="Kreait\Laravel\Firebase\ServiceProvider").kreait/laravel-firebase to composer.json..env with FIREBASE_DATABASE_URL and credentials.Firebase::auth()->createCustomToken($uid)).Legacy Systems:
Auth interface to the package’s implementation).FirebaseAuth in favor of Firebase::auth()).firebase-php v8.x, so existing SDK code can often be reused with minor adjustments.Laravel Versions:
Firebase SDK:
firebase-php to v8.x, which supports all Firebase services. Ensure your Firebase project’s SDK version is compatible (e.g., no breaking API changes).Environment Variables:
FIREBASE_DATABASE_URL (for Realtime DB/Firestore).FIREBASE_CREDENTIALS: Path to service account JSON.GOOGLE_APPLICATION_CREDENTIALS: Fallback for auto-discovery.FIREBASE_PROJECT_ID).Phase 1: Setup and Configuration
Phase 2: Core Services Integration
Auth::createCustomToken()).Firebase::storage() for file uploadsHow can I help you explore Laravel packages today?