PHPackages                             cimons/larafcm - 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. [API Development](/categories/api)
4. /
5. cimons/larafcm

ActiveLibrary[API Development](/categories/api)

cimons/larafcm
==============

Laravel FCM Package

172PHP

Since Jul 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/cimons/larafcm)[ Packagist](https://packagist.org/packages/cimons/larafcm)[ RSS](/packages/cimons-larafcm/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel-FCM
===========

[](#laravel-fcm)

Introduction
------------

[](#introduction)

Laravel-FCM is an easy to use package working with both Laravel and Lumen for sending push notification with [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/) (FCM).

It currently **only supports HTTP protocol** for :

- sending a downstream message to one device

> Note: The XMPP protocol is not currently supported.

Installation
------------

[](#installation)

To get the latest version of Laravel-FCM on your project, require it from "composer":

```
$ composer require cimons/larafcm:dev-master

```

Or you can add it directly in your composer.json file:

```
{
	"require": {
    	   "cimons/larafcm": "dev-master"
	}
}

```

### Laravel

[](#laravel)

Register the provider directly in your app configuration file config/app.php `config/app.php`:

```
'providers' => [
	// ...

	Cimons\LaraFcm\LaraFcmServiceProvider::class,
]
```

Add the facade aliases in the same file:

```
'aliases' => [
	...
	'FCM'             => Cimons\LaraFcm\Facades\FCM::class,
]
```

Copy the config file `fcm.php` manually from the directory `/vendor/cimons/larafcm/config` to the directory `/config ` (you may need to create this directory).

### Package Configuration

[](#package-configuration)

In your `.env` file, add the server key and the secret key for the Firebase Cloud Messaging:

```
FCM_SERVER_KEY=my_secret_server_key
FCM_SENDER_ID=my_secret_sender_id
```

### Downstream Messages

[](#downstream-messages)

A downstream message is a notification message, a data message, or both, that you send to a target device or to multiple target devices using its registration\_Ids.

The following use statements are required for the examples below:

```
use Cimons\LaraFcm\Message\NotificationBuilder;
use Cimons\LaraFcm\Facades\FCM;
```

#### Sending a Downstream Message to a Device

[](#sending-a-downstream-message-to-a-device)

```
$notificationBuilder = NotificationBuilder('my title');
$notificationBuilder->setBody('Hello world')
				    ->setSound('default');
$notification = $notificationBuilder->build();

$token = "a_registration_from_your_database";
$downstreamResponse = FCM::sendTo($token, $notification);

if ($downstreamResponse->isSent == 1) {
     echo "The message has been sent.";
} else {
    echo "The message could not be sent."
}
```

#### Licence

[](#licence)

This library is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

Some of this documentation is coming from the official documentation. You can find it completely on the [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/) Website.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

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

---

Top Contributors

[![cimons](https://avatars.githubusercontent.com/u/7411446?v=4)](https://github.com/cimons "cimons (6 commits)")

### Embed Badge

![Health badge](/badges/cimons-larafcm/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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