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

ActiveLibrary

veskodigital/laravel-fcm-channel
================================

Send notifications from Firebase cloud messenger from Laravel.

1301PHP

Since Apr 20Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel FCM Channel
===================

[](#laravel-fcm-channel)

[![Laravel FCM Channel](laravel_fcm.png)](laravel_fcm.png)

Manage FCM notifications with ease using Laravel FCM Channel.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

This package has been built to make sending FCM messages easier.

There is also a Flutter [package](https://pub.dev/packages/laravel_fcm) you can use to save time for mobile development.

**Overview:**

- Add multiple (FCM) devices to a model in Laravel
- API Routes for adding new devices to a model
- Send FCM notifications using the new "`fcm_channel`" in your Laravel Notification
- Flutter mobile package to help speed up your development with notifications

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

[](#installation)

First, install the package via composer:

```
composer require veskodigital/laravel-fcm-channel
```

The package will automatically register itself.

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

[](#configuration)

Run the `install` command.

```
php artisan laravelfcm:install
```

This will add a (`laravelfcm.php`) config file

ServiceProvider to your app.php: `App\Providers\FcmAppServiceProvider::class`

Then, ask if you want to run the migrations.

Here's the tables it will migrate:

- fcm\_user\_devices
- fcm\_user\_devices\_api\_requests

Add your FCM server token to your `.env` file.

```
LARAVEL_FCM_SERVER_KEY="MyFCMServerKey"
```

You can find your Fcm Server Key in your Firebase Project Settings &gt; Cloud Messaging.

You can fully configure this package in the `config/laravelfcm.php` file (this file should be added after you run `php artisan laravelfcm:install`).

Configuring your Model
----------------------

[](#configuring-your-model)

Add the `HasFCMDevices` trait to your User Model.

```
