PHPackages                             yusefarianpour/the-laravel-fcm-channel - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. yusefarianpour/the-laravel-fcm-channel

AbandonedArchivedProject[Mail &amp; Notifications](/categories/mail)

yusefarianpour/the-laravel-fcm-channel
======================================

Send notification from laravel to firebase cloud messaging.

V3.0.1(3y ago)012.1k[1 issues](https://github.com/yusefarianpour/the-laravel-fcm-channel/issues)MITPHPPHP ^8.0.2

Since Nov 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/yusefarianpour/the-laravel-fcm-channel)[ Packagist](https://packagist.org/packages/yusefarianpour/the-laravel-fcm-channel)[ RSS](/packages/yusefarianpour-the-laravel-fcm-channel/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (8)Dependencies (1)Versions (12)Used By (0)

The Laravel FCM Channel
=======================

[](#the-laravel-fcm-channel)

The Laravel Firebase Cloud Messaging(FCM) Notification Channel

Use this package to send push notifications via Laravel to Firebase Cloud Messaging. Laravel 5.3+ required.

Install
-------

[](#install)

This package can be installed through Composer.

```
composer require journalctl/laravel-to-fcm
```

Add your Firebase API Key to `config/services.php`

```
'fcm' => [
    'key' => 'Your Firebase Cloud Messaging token',
],
```

Example Usage
-------------

[](#example-usage)

Use Artisan to create a notification:

```
php artisan make:notification SomeNotification
```

Return `[fcm]` in the `public function via($notifiable)` method of your notification:

```
public function via($notifiable)
{
    return ['fcm'];
}
```

Or :

```
use Journalctl\Channels\FirebaseChannel;

...

public function via($notifiable)
{
    return [FirebaseChannel::class];
}
```

Add the method `public function toFcm($notifiable)` to your notification, and return an instance of `FirebaseMessage`:

```
use Journalctl\Channels\FirebaseChannel;
use Journalctl\Channels\FirebaseMessage;

...

public function toFcm($notifiable)
{
    $message = new FirebaseMessage();

    $message
        ->title('Foo')  // Required
        ->body('Bar')   // Required
        ->sound()   // Optional
        ->icon()   // Optional
        ->clickAction();    // Optional

    $message->data([
        'param1' => 'baz' // Optional
    ])->priority(FirebaseMessage::PRIORITY_HIGH); // Optional - Default is 'normal'.

    return $message;
}
```

When sending to specific device, make sure your notifiable entity has `routeNotificationForFcm` method defined:

```
/**
 * Route notifications for the Firebase Cloud Messaging channel.
 *
 * @return string
 */
public function routeNotificationForFcm()
{
    return $this->device_token;
}
```

License
-------

[](#license)

The "The Laravel FCM Channel" is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 98% 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 ~207 days

Recently: every ~449 days

Total

10

Last Release

1231d ago

Major Versions

V2.1.5 → V3.0.02022-12-28

PHP version history (2 changes)V2.0.1PHP &gt;=5.6.4

V3.0.0PHP ^8.0.2

### Community

Maintainers

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

---

Top Contributors

[![yusefarianpour](https://avatars.githubusercontent.com/u/479012?v=4)](https://github.com/yusefarianpour "yusefarianpour (48 commits)")[![mhanoglu](https://avatars.githubusercontent.com/u/8195419?v=4)](https://github.com/mhanoglu "mhanoglu (1 commits)")

---

Tags

fcmfirebase-cloud-messaginglaravellaravel-fcm-channelnotificationslaravelfirebaseFCMchannel

### Embed Badge

![Health badge](/badges/yusefarianpour-the-laravel-fcm-channel/health.svg)

```
[![Health](https://phpackages.com/badges/yusefarianpour-the-laravel-fcm-channel/health.svg)](https://phpackages.com/packages/yusefarianpour-the-laravel-fcm-channel)
```

###  Alternatives

[benwilkins/laravel-fcm-notification

Laravel FCM (Firebase Cloud Messaging) Notification Channel

210964.1k1](/packages/benwilkins-laravel-fcm-notification)[liliom/laravel-firebase

Laravel FCM (Firebase Cloud Messaging) Notification Channel

2426.1k](/packages/liliom-laravel-firebase)

PHPackages © 2026

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