- How do I install Larafirebase in a Laravel application?
- Run composer require kutia-digital-agency/larafirebase, then publish the package config with php artisan vendor:publish so the larafirebase config file lands in your config directory. Point the package at your Firebase service-account JSON through the config or an environment variable, and call the Larafirebase facade wherever you need to send a message. There are no migrations or database tables, so installation is just Composer, config, and credentials.
- Which Laravel versions does larafirebase support?
- Release 1.3.9 widens the composer constraints to Laravel 11, 12, and nominally 13, after an earlier release added 11.x support. If you are still on Laravel 10, upgrading to 1.3.9 is the change that lets you move the framework forward without a Composer conflict. Treat the Laravel 13 claim as forward-looking until that framework ships and the package CI matrix proves it, and re-check the minimum PHP version your Laravel release requires.
- How do I send a push notification to a single device with Larafirebase?
- Use the facade to target a device token and pass a notification payload with at least a title and body, plus any optional data payload key-value pairs. Larafirebase wraps the Firebase Cloud Messaging HTTP v1 send call, so the token, notification, and data all travel in one request. Keep the call inside your own service class or queued job rather than scattering facade calls across controllers.
- Can Larafirebase send notifications to topics or conditions?
- Yes. The package supports targeting devices, topics, and conditions through the same API, so you can fan out a message to a subscribed topic or use a condition expression without writing your own Firebase client. Topics and conditions are resolved server-side by FCM, which means no token list needs to be fetched or stored on your side.
- How do I configure Firebase credentials for Larafirebase?
- You supply a Firebase service-account JSON file and reference its path from the published config, typically via an environment variable. That file contains a long-lived private key, so inject it from a secrets manager, restrict filesystem permissions, and define a rotation policy instead of committing it to the repository. Avoid hardcoding the path or key material anywhere in application code.
- Is Larafirebase a Laravel notification channel?
- No. Larafirebase is a thin transport adapter made of a service provider, a facade, and a sender class that posts to Firebase Cloud Messaging, so you call the facade yourself or wrap it in your own channel. If you want to keep using Laravel's notification system, write a small channel class that delegates to the facade so your notification classes stay framework-idiomatic.
- Does Larafirebase handle queues, retries, or batching?
- It does not. The package ships no queue integration, retry or backoff policy, token lifecycle management, or batching, so all of that is your responsibility. Wrap facade calls in a queued job, configure your own retry and backoff settings, and prune invalid or expired tokens from your data store. Keeping that logic in one wrapper class instead of inline calls makes it far easier to maintain.
- How do I test Larafirebase without hitting Firebase?
- Because sends go through the Larafirebase facade, you can swap it with a fake or mock in your test suite and assert on the payloads your code builds. That keeps feature tests fast and offline while still verifying the right tokens, topics, and notification data are passed through. Reserve any live Firebase call for a small number of integration tests, if you keep them at all.
- Is it safe to upgrade larafirebase from 1.3.8 to 1.3.9?
- There are no documented config key changes, facade signature changes, or namespace moves, so the upgrade delta is essentially a Composer constraint widening. The risk is that 1.3.9 is only a patch release yet claims support for Laravel 11, 12, and 13 at once, which changes dependency resolution for every consumer. Pin an exact version and upgrade deliberately rather than floating on ^1.3 if you want controlled rollouts.
- What are the alternatives to Larafirebase for push notifications in Laravel?
- The main alternatives are kreait/laravel-firebase, a broader Firebase Admin SDK wrapper, and laravel-notification-channels/fcm, which plugs directly into Laravel's notification system as a channel. Larafirebase is the leanest option if all you need is to post FCM messages through a simple facade and you are comfortable owning queueing, retries, and token management yourself. Whichever you choose, confirm the package actively supports your Laravel version before adopting it.