PHPackages                             ankurk91/fcm-notification-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. ankurk91/fcm-notification-channel

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

ankurk91/fcm-notification-channel
=================================

Firebase push notification channel for Laravel

2.2.0(1y ago)7346.3k↓12.8%9MITPHPPHP ^8.2CI passing

Since Jan 19Pushed 2mo ago3 watchersCompare

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

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

FCM Notification Channel for Laravel
====================================

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

[![Packagist](https://camo.githubusercontent.com/fe1a7c1b0270a0494e5c0a9ac740f8da7c31745c18096c39bce3d15fb197274b/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f616e6b75726b39312f66636d2d6e6f74696669636174696f6e2d6368616e6e656c)](https://packagist.org/packages/ankurk91/fcm-notification-channel)[![GitHub-tag](https://camo.githubusercontent.com/43b67c9c7f95a0542e4b4776218b048f6e87d5d838f8114e05064321614f8fdc/68747470733a2f2f62616467656e2e6e65742f6769746875622f7461672f616e6b75726b39312f66636d2d6e6f74696669636174696f6e2d6368616e6e656c)](https://github.com/ankurk91/fcm-notification-channel/tags)[![License](https://camo.githubusercontent.com/a71afe505dcdae39eea10a93ef97bc0ea569e2fa733f76ef2f9629fb9f17f9dd/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f6c6963656e73652f616e6b75726b39312f66636d2d6e6f74696669636174696f6e2d6368616e6e656c)](LICENSE.txt)[![Downloads](https://camo.githubusercontent.com/347da4341cac346c424dd6b513ff945d7c7e50126bf107309013c4bf6a201841/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f616e6b75726b39312f66636d2d6e6f74696669636174696f6e2d6368616e6e656c)](https://packagist.org/packages/ankurk91/fcm-notification-channel/stats)[![GH-Actions](https://github.com/ankurk91/fcm-notification-channel/workflows/tests/badge.svg)](https://github.com/ankurk91/fcm-notification-channel/actions)[![codecov](https://camo.githubusercontent.com/fed20f32d32d491aca9260dfbca566c69e9f083b67dd810d0171d618b01a461e/68747470733a2f2f636f6465636f762e696f2f67682f616e6b75726b39312f66636d2d6e6f74696669636174696f6e2d6368616e6e656c2f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/ankurk91/fcm-notification-channel)

Send [Firebase](https://firebase.google.com/docs/cloud-messaging) push notifications with Laravel php framework.

Highlights
----------

[](#highlights)

- Using the latest Firebase HTTP v1 [API](https://firebase.google.com/docs/cloud-messaging/migrate-v1)
- Send message to a topic or condition 😉
- Send message to a specific device or multiple devices (Multicast)
- Send additional RAW data with notification
- Supports multiple Firebase projects in single Laravel app:fire:
- Invalid token handling with event and listeners
- Fully tested package with automated test cases
- Powered by battle tested [Firebase php SDK](https://firebase-php.readthedocs.io/) 🚀

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

[](#installation)

You can install this package via composer:

```
composer require "ankurk91/fcm-notification-channel"
```

Configuration
-------------

[](#configuration)

This package relies on [laravel-firebase](https://github.com/kreait/laravel-firebase) package to interact with Firebase services. Here is the minimal configuration you need in your `.env` file

```
# relative or full path to the Service Account JSON file
FIREBASE_CREDENTIALS=firebase-credentials.json
```

You will need to create a [service account](https://firebase.google.com/docs/admin/setup#initialize-sdk)and place the JSON file in your project root.

Additionally, you can update your `.gitignore` file

```
/firebase-credentials*.json
```

Usage
-----

[](#usage)

You can use the FCM channel in the `via()` method inside your Notification class:

```
