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

ActiveLibrary

bilalmardini/firebase-notification
==================================

Laravel Firebase Notification is a robust and user-friendly package designed to integrate Firebase Cloud Messaging (FCM) with Laravel applications. This package streamlines the process of sending notifications to users through Firebase, supporting various notification targeting options and customization features.

v1.3.0(11mo ago)1670MITPHP

Since Nov 9Pushed 11mo ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (5)Used By (0)

Laravel Firebase Notification
=============================

[](#laravel-firebase-notification)

[![Package Image](https://private-user-images.githubusercontent.com/76524754/384639867-7a4cece0-f86a-4b40-8a6f-5f1ec533edae.jpeg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1OTYxMTgsIm5iZiI6MTc3NTU5NTgxOCwicGF0aCI6Ii83NjUyNDc1NC8zODQ2Mzk4NjctN2E0Y2VjZTAtZjg2YS00YjQwLThhNmYtNWYxZWM1MzNlZGFlLmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwN1QyMTAzMzhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hYWZlMjhkMjQ3OTU1NzAwYzVmMWUwNTBmODc5NjY2NzJmMGU0OWZiMjk3YWJmMjllNzFlMzJiOTQ4Yzg4NjcyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.8qeFcKw3B-DVPpbiyP7jUDySj5LDuJsuY1IjoOc3wiE)](https://private-user-images.githubusercontent.com/76524754/384639867-7a4cece0-f86a-4b40-8a6f-5f1ec533edae.jpeg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1OTYxMTgsIm5iZiI6MTc3NTU5NTgxOCwicGF0aCI6Ii83NjUyNDc1NC8zODQ2Mzk4NjctN2E0Y2VjZTAtZjg2YS00YjQwLThhNmYtNWYxZWM1MzNlZGFlLmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwN1QyMTAzMzhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hYWZlMjhkMjQ3OTU1NzAwYzVmMWUwNTBmODc5NjY2NzJmMGU0OWZiMjk3YWJmMjllNzFlMzJiOTQ4Yzg4NjcyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.8qeFcKw3B-DVPpbiyP7jUDySj5LDuJsuY1IjoOc3wiE)

[![Packagist Downloads](https://camo.githubusercontent.com/6942af8288109177d3dc771796c984e8838778ea54caaeaae64bd6932dcf11c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62696c616c6d617264696e692f66697265626173652d6e6f74696669636174696f6e)](https://packagist.org/packages/bilalmardini/firebase-notification)[![Latest Version](https://camo.githubusercontent.com/f3e5493aaa07a416ccf25b5ee46a49c9ba73a23114104bd5c6eaf65e97a86528/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62696c616c6d617264696e692f66697265626173652d6e6f74696669636174696f6e)](https://packagist.org/packages/bilalmardini/firebase-notification)

Overview
--------

[](#overview)

**Laravel Firebase Notification** is a powerful package for integrating **Firebase Cloud Messaging (FCM)** into Laravel applications. It provides an intuitive interface for sending push notifications to users, targeting individuals, groups, or topics for broadcast notifications.

Features
--------

[](#features)

- **Push Notifications**: Send notifications via Firebase Cloud Messaging (FCM).
- **Topic-Based Notifications**: Broadcast messages to subscribers.
- **User-Specific Notifications**: Send personalized messages.
- **Custom Payloads**: Include icons, titles, bodies, and additional data.
- **Rich Media Support**: Customizable message structure with deep linking.
- **Secure Delivery**: Authentication with Firebase using a service account key.

Requirements
------------

[](#requirements)

- **PHP**: 7.4 or higher
- **Laravel**: 8.x or higher
- **Firebase**: A project with Cloud Messaging enabled
- **Credentials**: Firebase Service Account credentials

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

[](#installation)

Install the package via Composer:

```
composer require bilalmardini/firebase-notification
```

If you are not using Laravel package auto-discovery, add the service provider in `config/app.php`:

```
'providers' => [
    // Other Service Providers
    BilalMardini\FirebaseNotification\Providers\FirebaseNotificationServiceProvider::class,
],
```

Publish the configuration file to set up your Firebase credentials:

```
php artisan vendor:publish --provider="BilalMardini\FirebaseNotification\Providers\FirebaseNotificationServiceProvider"
```

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

[](#configuration)

Set your Firebase credentials in the published configuration file (`config/firebase.php`):

```
return [
    'credentials_file_path' => base_path('firebase.json'),
    'project_id' => 'your-firebase-project-id'
];
```

Usage
-----

[](#usage)

### Sending a Notification

[](#sending-a-notification)

#### 1. Topic-Based Notification (Global News Update)

[](#1-topic-based-notification-global-news-update)

Send a notification to all users subscribed to a specific topic:

```
