PHPackages                             sv1ft/laravel-fcm - 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. sv1ft/laravel-fcm

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

sv1ft/laravel-fcm
=================

A powerful Laravel package to send Push Notifications

1.0.7(2y ago)0443MITPHPPHP ^8.2

Since Sep 27Pushed 2y agoCompare

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

READMEChangelog (8)Dependencies (5)Versions (9)Used By (0)

Laravel FCM
===========

[](#laravel-fcm)

 [![Laravel](https://camo.githubusercontent.com/e389ddf87008f75cf99e2b1687428187014c7b4ad04bad330f9d916c08fa3575/68747470733a2f2f62616467656e2e6e65742f62616467652f4c61726176656c2f3e3d20352e782f677265656e)](https://laravel.com/) [![GitHub](https://camo.githubusercontent.com/3e0f4681e15296c4f47b6f0fdc0445af2bb26768c204c587f7ccc4adda07cff8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77696c6c69616d6372757a6d652f6c61726176656c2d66636d)](https://github.com/williamcruzme/laravel-fcm)

laravel-fcm is a powerful [Laravel](https://laravel.com/) package to send [Push Notifications](https://firebase.google.com/docs/cloud-messaging) to all devices of one or many users. Being channel-based you only need to specify the `channel` in your Laravel [Notification](https://laravel.com/docs/master/notifications).

Features
--------

[](#features)

- Easy integration
- Compatible with any version of Laravel
- Send notifications to all devices of one or many users at the same time
- Send millions of notifications in batch
- Fully customizable and adaptable
- Queue support

📄 Content
---------

[](#-content)

- [Installation](#-installation)
- [Create Notification](#-create-notification)
- [Routes](#-routes)
- [Customizing The Notification](#-customizing-the-notification)
- [Customizing The Controller](#-customizing-the-controller)

💿 Installation
--------------

[](#-installation)

```
composer require williamcruzme/laravel-fcm
```

### 1. Configure the enviroment

[](#1-configure-the-enviroment)

Get the Service Account and paste in your `.env` file:
*(gear-next-to-project-name) &gt; Project Settings &gt; Cloud Messaging*

```
FIREBASE_CREDENTIALS=/path/to/service-account.json
```

### 2. Adding traits

[](#2-adding-traits)

In your `App\Models\User` model add the `HasDevices` trait:

```
