PHPackages                             dwivedianuj9118/firebase-fcm-notification - 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. dwivedianuj9118/firebase-fcm-notification

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

dwivedianuj9118/firebase-fcm-notification
=========================================

This is laravel Firebase Cloud Messaging(FCM) Notification package for Php developer

028PHP

Since Jul 13Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/dwivedianuj9118/laravel-firebase-fcm-notification)[ Packagist](https://packagist.org/packages/dwivedianuj9118/firebase-fcm-notification)[ RSS](/packages/dwivedianuj9118-firebase-fcm-notification/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Firebase FCM Notification for Laravel
=====================================

[](#firebase-fcm-notification-for-laravel)

A Laravel wrapper to send Firebase Cloud Messaging (FCM) notifications via tokens, topics, or multicast using the [kreait/firebase-php](https://github.com/kreait/firebase-php) SDK.

Required Dependency
-------------------

[](#required-dependency)

```
composer require "kreait/firebase-php:^7.0"
```

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require dwivedianuj9118/firebase-fcm-notification
or
composer require dwivedianuj9118/firebase-fcm-notification:dev-main
```

### Vendor Publish

[](#vendor-publish)

```
php artisan vendor:publish --tag=papaya-fcm-config
```

🔐 Setup
-------

[](#-setup)

Add your Firebase credentials:

Download your firebase\_credentials.json from Firebase Console.

Place the file at the following location in your Laravel project:

```
/public/firebase_credentials.json
```

### ✅ Features

[](#-features)

Send push notifications to:

1. Individual device tokens
2. Topics
3. Multiple devices (Multicast)
4. Send both notification and data payloads
5. Logs notifications via Laravel logging

🚀 Usage
-------

[](#-usage)

Import the NotificationService class:

```
use Dwivedianuj9118\FirebaseFcmNotification\NotificationService;
```

### 🔹 Send Notification to Device Token

[](#-send-notification-to-device-token)

```
NotificationService::sendTokenFcm(
    $fcmToken,
    'Welcome!', // Title
    'You have a new message.', // body Description
    'https://example.com/image.jpg' // Optional image
    'sound url' //Optional Sound
);
```

### 🔹 Send Notification to Topic

[](#-send-notification-to-topic)

```
NotificationService::sendTopicFcm(
    'news', // topic name
    'Breaking News!', // Title
    'Check out our latest update', // body Description
    null, // Optional image
    'default' //Optional Sound
);
```

### 🔹 Send Multicast Notification (Multiple Devices)

[](#-send-multicast-notification-multiple-devices)

```
NotificationService::sendMulticastFCM(
    [$token1, $token2], // multiple token separated by ,(commas)
    'Group Message', //Title
    'This is sent to multiple devices.' // Body
);
```

Send Custom Notice (Flexible)
-----------------------------

[](#send-custom-notice-flexible)

```
$data = [
    'title' => 'Custom Title',
    'body' => 'This is a custom message body',
    'custom_key' => 'custom_value'
];

// For notification
NotificationService::sendNotice($data, 'token', $fcmToken, 'notification');

// For data only
NotificationService::sendNotice($data, 'token', $fcmToken, 'data');
```

📝 Logging
---------

[](#-logging)

All notifications and errors are automatically logged via Laravel’s Log::info and Log::error.

🛠 Dependencies
--------------

[](#-dependencies)

- kreait/firebase-php
- Laravel 8+

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Anuj Dwivedi](https://github.com/dwivedianuj9118)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance40

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 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/11f544e266a70d2f326cdfb15bfddc3f702c1f289a01e8fd51e9b49e24dd17e1?d=identicon)[dwivedianuj9118](/maintainers/dwivedianuj9118)

---

Top Contributors

[![dwivedianuj9118](https://avatars.githubusercontent.com/u/36004286?v=4)](https://github.com/dwivedianuj9118 "dwivedianuj9118 (10 commits)")

### Embed Badge

![Health badge](/badges/dwivedianuj9118-firebase-fcm-notification/health.svg)

```
[![Health](https://phpackages.com/badges/dwivedianuj9118-firebase-fcm-notification/health.svg)](https://phpackages.com/packages/dwivedianuj9118-firebase-fcm-notification)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[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)
