PHPackages                             liliom/laravel-firebase - 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. liliom/laravel-firebase

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

liliom/laravel-firebase
=======================

Laravel FCM (Firebase Cloud Messaging) Notification Channel

v1.0.1(8y ago)2426.1k11[1 PRs](https://github.com/multicaret/laravel-firebase/pulls)MITPHPPHP &gt;=5.5.9

Since Aug 12Pushed 6y ago2 watchersCompare

[ Source](https://github.com/multicaret/laravel-firebase)[ Packagist](https://packagist.org/packages/liliom/laravel-firebase)[ RSS](/packages/liliom-laravel-firebase/feed)WikiDiscussions master Synced 1mo ago

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

laravel-firebase
================

[](#laravel-firebase)

This package makes it easy to send notifications using [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/) (FCM) with Laravel Notification Channel.

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

[](#installation)

This package can be installed through Composer.

```
composer require liliom/laravel-firebase
```

If you don't use Laravel 5.5+ you have to add the service provider manually

```
// config/app.php
'providers' => [
    ...
    Liliom\Firebase\FirebaseServiceProvider::class,
    ...
];
```

Now add you Firebase API Key in `config/services.php`.

```
return [
	....
    'firebase' => [
        'key' => ''
    ],
    ....
];
```

Usage
-----

[](#usage)

Les's create a notification using artisan commend:

```
php artisan make:notification FirebaseNotification
```

Now you can use `firebase` channel in your `vie()` mothod.

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

Add a pubilc method `toFirebase($notifiable)` to your notification class, and return an instance of `FirebaseMessage`:

```
public function toFirebase($notifiable)
{
    return (new \Liliom\Firebase\FirebaseMessage)
        ->notification([
            'title' => 'Notification title',
            'body' => 'Notification body',
            'sound' => '', // Optional
	    'icon' => '', // Optional
	    'click_action' => '' // Optional
        ])
        ->setData([
	    'param' => 'zxy' // Optional
	])
	->setPriority('high'); // Default is 'normal'
}
```

Available methods:
------------------

[](#available-methods)

- `setData`: To Set `data`.
- `setPriority`: To Set `priority`.
- `setTimeToLive`: To Set `time_to_live`.
- `setCollapseKey`: To Set `collapse_key`.
- `setNotification`: To Set `notification`.
- `setCondition`: To Set `condition`.
- `setContentAvailable`: To Set `content_available`.
- `setMutableContent`: To Set `mutable_content`.
- `setPackageName`: To Set `restricted_package_name`.

When sending to specific device(s), make sure your notifiable entity has `routeNotificationForFirebase` method defined:

> **Note:** You can send to many devices by return an array of tokens.

```
/**
 * Route notifications for Firebase channel.
 *
 * @return string|array
 */
public function routeNotificationForFirebase()
{
    return $this->device_tokens;
}
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~197 days

Total

2

Last Release

3004d ago

### Community

Maintainers

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

---

Top Contributors

[![Hussam3bd](https://avatars.githubusercontent.com/u/8091592?v=4)](https://github.com/Hussam3bd "Hussam3bd (8 commits)")[![Evertt](https://avatars.githubusercontent.com/u/1267282?v=4)](https://github.com/Evertt "Evertt (1 commits)")[![mkwsra](https://avatars.githubusercontent.com/u/1743919?v=4)](https://github.com/mkwsra "mkwsra (1 commits)")

---

Tags

fcmfcm-notificationsfirebase-cloud-messaginglaravel-5-packagelaravel-firebasenotification-channelnotificationslaravelnotificationfirebaseFCMchannelnotification-channel

### Embed Badge

![Health badge](/badges/liliom-laravel-firebase/health.svg)

```
[![Health](https://phpackages.com/badges/liliom-laravel-firebase/health.svg)](https://phpackages.com/packages/liliom-laravel-firebase)
```

###  Alternatives

[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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