PHPackages                             laradevs/notifications-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. laradevs/notifications-fcm

ActiveLibrary

laradevs/notifications-fcm
==========================

A package to send Firebase notification cross Laravel Application

v1.0.2(1y ago)255MITPHPPHP ^5.6|^7.0|^8.0|^8.1|^8.2CI failing

Since Mar 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/laradevs/notifications-fcm)[ Packagist](https://packagist.org/packages/laradevs/notifications-fcm)[ RSS](/packages/laradevs-notifications-fcm/feed)WikiDiscussions master Synced today

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

[![](https://avatars2.githubusercontent.com/u/51764637?s=200&v=4)](https://avatars2.githubusercontent.com/u/51764637?s=200&v=4)

Notifications FCM
=================

[](#notifications-fcm)

this package is forked from [kawnkoding/laravel-fcm](https://github.com/kawankoding/laravel-fcm) and adjustments and unit tests have been done for your work with queues and additional parameters

### Installation

[](#installation)

You can pull the package via composer :

```
$ composer require laradevs/notifications-fcm
```

Next, You must register the service provider :

```
// config/app.php

'Providers' => [
   // ...
   LaraDevs\Fcm\FcmServiceProvider::class,
]
```

If you want to make use of the facade you must install it as well :

```
// config/app.php

'aliases' => [
    // ...
    'Fcm' => LaraDevs\Fcm\FcmFacade::class,
];
```

Next, You must publish the config file to define your FCM server key :

```
php artisan vendor:publish --provider="LaraDevs\Fcm\FcmServiceProvider"
```

This is the contents of the published file :

```
return [

    /**
     * Set your FCM Server Key
     * Change to yours
     */

    'server_key' => env('FCM_SERVER_KEY', ''),
    'server_endpoint' => env('FCM_SERVER_ENDPOINT', 'https://fcm.googleapis.com/fcm/send'),
    'server_icon_app'=> env('FCM_ICON_APP')

];
```

```
importScripts('https://www.gstatic.com/firebasejs/3.9.0/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/3.9.0/firebase-messaging.js');

// Initialize Firebase
var config = {
    apiKey: "YOUR-API-KEY",
    authDomain: "YOUR-DOMAIN",
    databaseURL: "YOUR-DATABASE-URL",
    projectId: "YOUR-PROJECT-ID",
    storageBucket: "YOUR-STORAGE-BUCKET",
    messagingSenderId: "YOUR-MESSAGING-SENDER",
    appId: "YOUR-APP-ID",
    measurementId: "YOUR-MEASURE-ID"
};

firebase.initializeApp(config);
const messaging = firebase.messaging();
```

Set your FCM Server Key in `.env` file :

```
APP_NAME="Laravel"
# ...
FCM_SERVER_KEY=putYourKeyHere
FCM_SERVER_ENDPOINT=putServerEndpointHere
FCM_ICON_APP=putIconNotification

```

### Usage with JOBS

[](#usage-with-jobs)

If you want to use FCM in a simple way, do it through the following JOB

```
FcmSendJob::dispatch('Hello World',['RECIPIENTS_IDs']);
```

If you want to use FCM with queues, please do as follows

```
FcmSendJob::dispatch('Hello World',['RECIPIENTS_IDs'])->onqueue('NAME_QUEUE');
```

### Usage without JOBS

[](#usage-without-jobs)

If You want to send a FCM with just notification parameter, this is an example of usage sending a FCM with only data parameter :

```
fcm()
    ->to($recipients) // $recipients must an array
    ->priority('high')
    ->timeToLive(0)
    ->data([
        'title' => 'LaradevTest',
        'body' => 'This tests laraDevs',
    ])
    ->send();
```

If You want to send a FCM to topic, use method toTopic($topic) instead to() :

```
fcm()
    ->toTopic($topic) // $topic must an string (topic name)
    ->priority('normal')
    ->timeToLive(0)
    ->notification([
        'title' => 'LaradevTest',
        'body' => 'This tests laraDevs',
    ])
    ->send();
```

If You want to send a FCM with just notification parameter, this is an example of usage sending a FCM with only notification parameter :

```
fcm()
    ->to($recipients) // $recipients must an array
    ->priority('high')
    ->timeToLive(0)
    ->notification([
        'title' => 'LaradevTest',
        'body' => 'This tests laraDevs',
    ])
    ->send();
```

If You want to send a FCM with both data &amp; notification parameter, this is an example of usage sending a FCM with both data &amp; notification parameter :

```
fcm()
    ->to($recipients) // $recipients must an array
    ->priority('normal')
    ->timeToLive(0)
    ->data([
        'title' => 'LaradevTest',
        'body' => 'This tests laraDevs',
    ])
    ->notification([
        'title' => 'LaradevTest',
        'body' => 'This tests laraDevs',
    ])
    ->send();
```

Customize the icon and action, doing the following :

```
fcm()
    ->to($recipients) // $recipients must an array
    ->priority('normal')
    ->timeToLive(0)
    ->data([
        'title' => 'LaradevTest',
        'body' => 'This tests laraDevs',
        'icon' => 'Your URL public to icon',
        'click_action'=>'action click'
    ])
    ->send();
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity72

Established project with proven stability

 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 ~862 days

Total

3

Last Release

516d ago

PHP version history (2 changes)v1.0PHP &gt;=7.2

v1.0.2PHP ^5.6|^7.0|^8.0|^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/d137cbee024defb0122c632ee00a4a593131bf981d559abb9dc807e29aa1f9c8?d=identicon)[eliberio-soft](/maintainers/eliberio-soft)

---

Top Contributors

[![satoblacksato](https://avatars.githubusercontent.com/u/18121577?v=4)](https://github.com/satoblacksato "satoblacksato (9 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61214.2k26](/packages/slowlyo-owl-admin)

PHPackages © 2026

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