PHPackages                             kutia-software-company/larafirebase - 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. kutia-software-company/larafirebase

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

kutia-software-company/larafirebase
===================================

Laravel Firebase Cloud Messaging.

1.3.9(6d ago)372679.3k↓21.7%832MITPHP

Since Jan 29Pushed 6d ago11 watchersCompare

[ Source](https://github.com/kutia-software-company/larafirebase)[ Packagist](https://packagist.org/packages/kutia-software-company/larafirebase)[ Docs](https://github.com/kutia-software-company/larafirebase)[ RSS](/packages/kutia-software-company-larafirebase/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (4)Versions (19)Used By (2)

[![](/art/cover.png)](/art/cover.png)

 [ ![Total Downloads](https://camo.githubusercontent.com/8db1d1fd0f1778921a4d6eb8f857528b1aa6e5e30f765234c02a5e6717cb8d23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b757469612d736f6674776172652d636f6d70616e792f6c6172616669726562617365) ](https://packagist.org/packages/kutia-software-company/larafirebase) [ ![Latest Stable Version](https://camo.githubusercontent.com/d2add87a8bcd3142965434e76594bc228c3af1eb583509eca4113e53a90b1188/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b757469612d736f6674776172652d636f6d70616e792f6c6172616669726562617365) ](https://packagist.org/packages/kutia-software-company/larafirebase) [ ![License](https://camo.githubusercontent.com/ca29e931c385db5c15e00f23e444fa2d891d284b8e327238ecea18756c140b5e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b757469612d736f6674776172652d636f6d70616e792f6c6172616669726562617365) ](https://packagist.org/packages/kutia-software-company/larafirebase)

### Introduction

[](#introduction)

**Larafirebase** is a package thats offers you to send push notifications or custom messages via Firebase in Laravel.

Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably deliver messages at no cost.

For use cases such as instant messaging, a message can transfer a payload of up to 4KB to a client app.

### Installation

[](#installation)

Follow the steps below to install the package.

**Composer**

```
composer require kutia-software-company/larafirebase

```

**Copy Config**

Run `php artisan vendor:publish --provider="Kutia\Larafirebase\Providers\LarafirebaseServiceProvider"` to publish the `larafirebase.php` config file.

**Get Athentication Key**

Get Authentication Key from

**Configure larafirebase.php as needed**

```
'authentication_key' => '{AUTHENTICATION_KEY}'

```

### Usage

[](#usage)

Follow the steps below to find how to use the package.

Example usage in **Controller/Service** or any class:

```
use Kutia\Larafirebase\Facades\Larafirebase;

class MyController
{
    private $deviceTokens =['{TOKEN_1}', '{TOKEN_2}'];

    public function sendNotification()
    {
        return Larafirebase::withTitle('Test Title')
            ->withBody('Test body')
            ->withImage('https://firebase.google.com/images/social.png')
            ->withIcon('https://seeklogo.com/images/F/firebase-logo-402F407EE0-seeklogo.com.png')
            ->withSound('default')
            ->withClickAction('https://www.google.com')
            ->withPriority('high')
            ->withAdditionalData([
                'color' => '#rrggbb',
                'badge' => 0,
            ])
            ->sendNotification($this->deviceTokens);

        // Or
        return Larafirebase::fromArray(['title' => 'Test Title', 'body' => 'Test body'])->sendNotification($this->deviceTokens);
    }

    public function sendMessage()
    {
        return Larafirebase::withTitle('Test Title')
            ->withBody('Test body')
            ->sendMessage($this->deviceTokens);

        // Or
        return Larafirebase::fromArray(['title' => 'Test Title', 'body' => 'Test body'])->sendMessage($this->deviceTokens);
    }
}
```

Example usage in **Notification** class:

```
use Illuminate\Notifications\Notification;
use Kutia\Larafirebase\Messages\FirebaseMessage;

class SendBirthdayReminder extends Notification
{
    /**
     * Get the notification's delivery channels.
     */
    public function via($notifiable)
    {
        return ['firebase'];
    }

    /**
     * Get the firebase representation of the notification.
     */
    public function toFirebase($notifiable)
    {
        $deviceTokens = [
            '{TOKEN_1}',
            '{TOKEN_2}'
        ];

        return (new FirebaseMessage)
            ->withTitle('Hey, ', $notifiable->first_name)
            ->withBody('Happy Birthday!')
            ->asNotification($deviceTokens); // OR ->asMessage($deviceTokens);
    }
}
```

### Tips

[](#tips)

- Check example how to receive messages or push notifications in a [JavaScript client](/javascript-client).
- You can use `larafirebase()` helper instead of Facade.

### Payload

[](#payload)

Check how is formed payload to send to firebase:

Example 1:

```
Larafirebase::withTitle('Test Title')->withBody('Test body')->sendNotification('token1');
```

```
{
  "registration_ids": [
    "token1"
  ],
  "notification": {
    "title": "Test Title",
    "body": "Test body"
  },
  "priority": "normal"
}
```

Example 2:

```
Larafirebase::withTitle('Test Title')->withBody('Test body')->sendMessage('token1');
```

```
{
  "registration_ids": [
    "token1"
  ],
  "data": {
    "title": "Test Title",
    "body": "Test body"
  }
}
```

If you want to create payload from scratch you can use method `fromRaw`, for example:

```
return Larafirebase::fromRaw([
    'registration_ids' => ['token1', 'token2'],
    'data' => [
        'key_1' => 'Value 1',
        'key_2' => 'Value 2'
    ],
    'android' => [
        'ttl' => '1000s',
        'priority' => 'normal',
        'notification' => [
            'key_1' => 'Value 1',
            'key_2' => 'Value 2'
        ],
    ],
])->send();
```

---

Made with ♥ by Gentrit Abazi ([@gentritabazi](https://github.com/gentritabazi)).

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance99

Actively maintained with recent releases

Popularity58

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~131 days

Recently: every ~358 days

Total

16

Last Release

6d ago

### Community

Maintainers

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

---

Top Contributors

[![gentritabazi](https://avatars.githubusercontent.com/u/35135482?v=4)](https://github.com/gentritabazi "gentritabazi (75 commits)")[![muhamedRadwan](https://avatars.githubusercontent.com/u/16479089?v=4)](https://github.com/muhamedRadwan "muhamedRadwan (5 commits)")[![ferasbbm](https://avatars.githubusercontent.com/u/49439225?v=4)](https://github.com/ferasbbm "ferasbbm (3 commits)")[![astritzeqiri](https://avatars.githubusercontent.com/u/8720176?v=4)](https://github.com/astritzeqiri "astritzeqiri (3 commits)")[![eiabea](https://avatars.githubusercontent.com/u/688128?v=4)](https://github.com/eiabea "eiabea (3 commits)")[![samushi](https://avatars.githubusercontent.com/u/3842345?v=4)](https://github.com/samushi "samushi (2 commits)")[![HarmJan1990](https://avatars.githubusercontent.com/u/22013950?v=4)](https://github.com/HarmJan1990 "HarmJan1990 (2 commits)")[![oriceon](https://avatars.githubusercontent.com/u/358823?v=4)](https://github.com/oriceon "oriceon (2 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![anggerpputro](https://avatars.githubusercontent.com/u/21016176?v=4)](https://github.com/anggerpputro "anggerpputro (1 commits)")[![nathangaskin](https://avatars.githubusercontent.com/u/6713866?v=4)](https://github.com/nathangaskin "nathangaskin (1 commits)")[![codebeauty](https://avatars.githubusercontent.com/u/596842?v=4)](https://github.com/codebeauty "codebeauty (1 commits)")[![alchalade](https://avatars.githubusercontent.com/u/9267638?v=4)](https://github.com/alchalade "alchalade (1 commits)")

---

Tags

firebasefirebase-cloud-messaginglarafirebaselaravellaravel-fcmlaravel-firebaselaravel-firebase-push-notificationlaravel-push-notificationslaravel-real-timenotificationsphpphp-fcmphp-firebase

### Embed Badge

![Health badge](/badges/kutia-software-company-larafirebase/health.svg)

```
[![Health](https://phpackages.com/badges/kutia-software-company-larafirebase/health.svg)](https://phpackages.com/packages/kutia-software-company-larafirebase)
```

###  Alternatives

[laravel-notification-channels/webpush

Web Push Notifications driver for Laravel.

9005.5M27](/packages/laravel-notification-channels-webpush)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[laravel-notification-channels/apn

Apple APN Push Notification Channel

2022.2M8](/packages/laravel-notification-channels-apn)[illuminate/mail

The Illuminate Mail package.

5910.6M501](/packages/illuminate-mail)[laravel-notification-channels/expo

Expo Notifications Channel for Laravel

67628.6k1](/packages/laravel-notification-channels-expo)

PHPackages © 2026

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