- How do I install larafirebase in a Laravel application?
- Install it with composer require kutia-software-company/larafirebase, then publish the package config file with the vendor:publish command. Add your Firebase credentials and endpoint settings as environment variables so they stay out of version control. After that you can inject the facade or the underlying service into your notification code. Plan roughly a half day of work including a staging send test.
- Does larafirebase support the Firebase Cloud Messaging HTTP v1 API?
- The package description states that it targets the FCM HTTP v1 API, which means OAuth2 service-account credentials rather than the retired legacy server key. Google has shut down the legacy FCM endpoints, so confirm the transport in the actual source and release notes for the exact version you install before committing to it. If you find legacy server-key code, treat that as a blocker for new work and look at kreait/firebase-php or a maintained fork.
- Which Laravel versions does larafirebase support?
- Release 1.3.9 widened the composer constraints to cover Laravel 11, 12 and 13 alongside the earlier 8.x to 10.x range, so teams already on Laravel 11 or 12 no longer need a constraint override. Note that the Laravel 13 entry is a forward-looking allow-list for an unreleased framework version, not validated compatibility. Check that the declared illuminate/support constraint intersects with your pinned PHP and Laravel versions before adopting.
- How do I send a push notification to a Firebase topic with larafirebase?
- Use the fluent builder exposed by the package facade, point it at a topic, then chain the notification title, body, sound and any data payload before calling send. The builder keeps the payload composition readable instead of forcing you to hand-write FCM JSON. If you need conditions or multiple topics combined with logical operators, verify that the current API surface exposes them, as coverage for advanced targeting varies by feature.
- Can I send data-only messages or custom payloads with larafirebase?
- Yes, the fluent builder is designed to compose notification payloads with data, sound and custom options alongside the standard title and body. Data-only messages are useful for silent sync triggers where you do not want the OS to render a notification. Check the README for the exact method names in your installed version, since the builder API has evolved across releases.
- How do I configure Firebase credentials for larafirebase?
- Publish the package config file and set your credentials plus endpoint configuration through environment variables, keeping the service account JSON out of the repository. With the HTTP v1 API you need a Google service account with the Firebase Cloud Messaging permission, not a legacy server key. Load the credentials per environment so staging and production use separate Firebase projects. Never commit the service account file; mount it as a secret in your deployment pipeline.
- Does larafirebase support device group messaging and multicast?
- The package advertises topic and device-group messaging, so you can address a group of registration tokens through a single notification key rather than looping over tokens yourself. Batch multicast behaviour and large token lists should be validated against your installed version, because FCM's multicast limits and error reporting shape how you handle partial failures. Token pruning for stale or unregistered devices is typically your responsibility, so build a cleanup path around the response you get back.
- Is larafirebase safe to use in production given its maintenance model?
- It is a small leaf dependency that only touches the outbound notification path, with no models, migrations or queue infrastructure, so it is easy to adopt or remove. The maintenance model appears to be low-cadence and PR-driven rather than vendor-backed, and release 1.3.9 absorbed four framework generations into a single patch bump. Pin the version in composer.json, read the diff before upgrading constraints, and wrap the facade behind an internal PushSender interface so the FCM dependency stays swappable. That wrapper also gives you a single seam for retries, logging and token cleanup.
- How do I test larafirebase without sending real push notifications?
- Because the package is exposed through a Laravel facade, you can swap the underlying binding in the container during tests and assert on the payload your code builds. The cleanest approach is to define an internal PushSender interface in your app, implement it with larafirebase, and fake that interface in feature tests. That keeps your test suite fast and independent of Firebase. Reserve real FCM sends for a small staging smoke test.
- What are the alternatives to larafirebase for Firebase push in Laravel?
- The most common alternatives are kreait/firebase-php, which covers the broader Firebase Admin SDK surface including HTTP v1 credentials, and laravel-notification-channels/fcm, which plugs FCM into Laravel's notification system. Larafirebase's appeal is its lightweight fluent builder for composing payloads rather than a full admin SDK. Choose it if you only need outbound FCM messaging and want minimal surface area; choose a broader SDK if you also need topic management, token validation or other Firebase services.