PHPackages                             heyharpreetsingh/fcm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. heyharpreetsingh/fcm

ActiveLibrary[Framework](/categories/framework)

heyharpreetsingh/fcm
====================

Laravel package to send push notification on mobile(android, ios), and web using Firebase Cloud Messaging.

1.0.0(1y ago)17822MITPHPPHP ^8.1

Since Jul 15Pushed 1y ago2 watchersCompare

[ Source](https://github.com/heyharpreetsingh/fcm)[ Packagist](https://packagist.org/packages/heyharpreetsingh/fcm)[ RSS](/packages/heyharpreetsingh-fcm/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Push notification using FCM (Firebase Cloud Messaging)
------------------------------------------------------

[](#push-notification-using-fcm-firebase-cloud-messaging)

Description
-----------

[](#description)

Send a push notification to user mobile, and web using FCM (Firebase Cloud Messaging).

### Installing via Composer

[](#installing-via-composer)

[Composer](http://getcomposer.org).

```
composer require heyharpreetsingh/fcm
```

Next, Register the service provider in file `bootstrap/providers.php` for L11 AND `config/app.php` in the `providers` key for l10

```
Heyharpreetsingh\FCM\Providers\FCMServiceProvider::class
```

Next, Generate new private key from your Firebase:

In order to get this file, let’s go to your Firebase projects page, then select your project and as shown below, go to `Project Settings`.

[![alt text](image.png)](image.png)

Click on the `Service accounts` tab, then Generate new private key.

[![alt text](image-1.png)](image-1.png)

A file named -firebase-adminsdk-.json get generated, and it is your ServiceAccount.json file! Rename it (or change the path) and you’re ready to go.

⚠️ Your file can be generated only 1 time, if you create a new key, it will be a different one. Although, your previous key/file will still working until you decide to delete it (click on Manage service account permissions).

Next, Put your `ServiceAccount.json` file in your project storage directory and add the name of json file in your project `.env` file:

```
FCM_GOOGLE_APPLICATION_CREDENTIALS=path/to/serviceAccountKey.json
```

### Send a push notification on mobile(android, ios), and web.

[](#send-a-push-notification-on-mobileandroid-ios-and-web)

use a `FCMFacade` to send a notification

```
use Heyharpreetsingh\FCM\Facades\FCMFacade;

FCMFacade::send([
   "message" => [
        "token" => "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...", //device token
        "notification" => [
                "body" => "This is an FCM notification message!",
                "title" => "FCM Message"
        ]
    ]
]);
```

You can pass additional data using the official doc of FCM.

```
- https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send
- https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#Message

```

If you have any issue or suggestion feel free to [contact](mailto:heyharpreetsingh@gmail.com "mail").

License
-------

[](#license)

Open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

663d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd7974635d4e8fdfc5608284cfd3b2e46aed2ac610fac98a1a3744628501c5af?d=identicon)[heyharpreetsingh](/maintainers/heyharpreetsingh)

---

Top Contributors

[![heyharpreetsingh](https://avatars.githubusercontent.com/u/149856513?v=4)](https://github.com/heyharpreetsingh "heyharpreetsingh (7 commits)")

---

Tags

frameworklaravelFCMFirebase Cloud Messaging

### Embed Badge

![Health badge](/badges/heyharpreetsingh-fcm/health.svg)

```
[![Health](https://phpackages.com/badges/heyharpreetsingh-fcm/health.svg)](https://phpackages.com/packages/heyharpreetsingh-fcm)
```

###  Alternatives

[hemp/presenter

Easy Model Presenters in Laravel

247592.6k1](/packages/hemp-presenter)[rahulalam31/laravel-abuse-ip

Block ip address of all spammer's around the world.

27431.5k](/packages/rahulalam31-laravel-abuse-ip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
