Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Fcm Laravel

Fcm Laravel Laravel Package

amdadulhaq/fcm-laravel

Send push notifications from Laravel via Firebase Cloud Messaging (FCM). A lightweight wrapper that lets you deliver notification and data messages to Android, iOS, and web clients through a simple, expressive API, with support for device tokens and topic-based delivery.

View on GitHub
Deep Wiki
Context7

A simple, lightweight, fast Firebase Cloud Messaging (FCM) notification channel for Laravel.

Frequently asked questions about Fcm Laravel
How do I install amdadulhaq/fcm-laravel in a Laravel application?
Install it with Composer using composer require amdadulhaq/fcm-laravel, then publish the package config with php artisan vendor:publish and select the FCM provider. After publishing, add your Firebase credentials to your .env file rather than editing config/fcm.php directly, so config caching and deploys stay clean. The package follows standard Laravel package conventions, so the service provider and facade are auto-discovered.
How do I send a push notification with this package?
You can either use the facade for direct sends or route notifications through Laravel's notification system using the package's FCM channel. With the notification channel, your notification class exposes a toFcm() style method that returns the target device token and payload. Confirm the exact method signature for your installed version against the README, since the 2.0 major release may have changed it.
Does amdadulhaq/fcm-laravel support topic-based delivery and data-only messages?
The package is described as supporting both device token and topic-based delivery, so sending to a subscribed topic should be possible alongside single-device pushes. Data message support and condition sends are less clearly documented, so verify them against the source or a quick test send before relying on them. If you need rich multi-platform targeting options, check what the underlying FCM API call in the package actually exposes.
What credentials does fcm-laravel need: a legacy server key or a service account JSON file?
That depends on which FCM API generation your installed version targets. Older releases used the legacy server key string, while a move to the FCM HTTP v1 API requires a service-account JSON file and OAuth2 token minting. Since the 1.3.0 to 2.0.0 bump is a major version, treat the credential format as a likely change and check the diff or README before upgrading. Store the service-account JSON in a secret manager and inject it via environment variables, never in the repository.
What changed between version 1.3.0 and 2.0.0 of this package?
The supplied release notes only link to a changelog without enumerating changes, so the exact breaking-change scope is unverified. A major version bump most likely covers things like dropping legacy server-key auth in favour of OAuth2 service accounts, renamed namespaces or classes, changed facade signatures, and a reshaped config file. Read the v1.3.0...v2.0.0 compare diff on GitHub and treat it as your upgrade guide, because there is no UPGRADE.md referenced.
Which PHP and Laravel versions does amdadulhaq/fcm-laravel require?
The exact constraint matrix is defined in the package's composer.json, and it may differ between the 1.x and 2.x lines. Check the PHP and Laravel constraints for the specific version you intend to install before committing, especially if you are on an older Laravel release. You also need an HTTP client such as Guzzle available, which Laravel ships with by default.
How does fcm-laravel compare to kreait/laravel-firebase or calling the FCM HTTP v1 API directly?
This package is a thin, lightweight wrapper focused only on push notifications, so it has a smaller surface area than the first-party kreait/laravel-firebase, which covers Firestore, Auth, Storage and more. If push is all you need, the smaller dependency and simpler config can be an advantage; if you expect to use other Firebase services, the broader SDK avoids adding a second integration later. Calling the HTTP v1 API directly is also viable but means handling OAuth2 token minting and payload shaping yourself.
Should FCM sends be queued in Laravel, and how does that work with the notification channel?
Yes. Network calls to Firebase should run on a queue so a slow or failing push does not block the request cycle, which is why Laravel notification classes typically implement ShouldQueue. Make sure a queue worker is running in every environment that sends push notifications, including staging. Also remember that queued sends mean failures surface asynchronously, so log and monitor them.
How can I test that push notifications are sent without hitting the real Firebase service?
Mock or fake the underlying HTTP client so the package's outbound FCM request is intercepted, then assert on the payload shape, target token and notification data. Contract tests that lock the request body are especially valuable when upgrading across the 2.0 boundary, since payload or credential changes may otherwise fail silently at runtime. Finish with a manual verification against a real Firebase project using test devices on both iOS and Android before promoting to production.
Is amdadulhaq/fcm-laravel actively maintained, and what is the risk of depending on it?
It is a single-maintainer open source package with an infrequent release cadence, so plan for the possibility that upstream FCM API changes outpace maintenance. Before adopting, check whether the repository has CI, a test suite and tagged release artifacts rather than bare tags. If push notifications are business critical, keep a fallback path in mind, such as switching to kreait/laravel-firebase or a small in-house HTTP v1 client, and isolate your call sites so a swap stays contained.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core