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

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

aliamassi/fcm-notification
==========================

Laravel package to send Firebase Cloud Messaging notifications to Android and iOS.

018PHP

Since Jul 9Pushed 10mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel FCM Notification
========================

[](#laravel-fcm-notification)

[![Packagist Version](https://camo.githubusercontent.com/67024add9687899f5a7acd1377459f683aab41b5f8a6bf6e1f2e3f66c79fa177/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c69616d617373692f66636d2d6e6f74696669636174696f6e)](https://camo.githubusercontent.com/67024add9687899f5a7acd1377459f683aab41b5f8a6bf6e1f2e3f66c79fa177/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c69616d617373692f66636d2d6e6f74696669636174696f6e)[![License](https://camo.githubusercontent.com/07909b17977b1028a697fbd0b56c35c6743f46c3fa45cfd05df676d96b6565b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616c69616d617373692f66636d2d6e6f74696669636174696f6e)](https://camo.githubusercontent.com/07909b17977b1028a697fbd0b56c35c6743f46c3fa45cfd05df676d96b6565b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616c69616d617373692f66636d2d6e6f74696669636174696f6e)[![Downloads](https://camo.githubusercontent.com/a51e2b6f4569bc7750a21d5551d3f047a81df9a09c245201d64819b351f12b07/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c69616d617373692f66636d2d6e6f74696669636174696f6e)](https://camo.githubusercontent.com/a51e2b6f4569bc7750a21d5551d3f047a81df9a09c245201d64819b351f12b07/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c69616d617373692f66636d2d6e6f74696669636174696f6e)

Laravel package to send Firebase Cloud Messaging (FCM) notifications to Android and iOS devices.

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

[](#requirements)

- PHP 8.0 or higher
- Laravel 8/9/10
- [google/auth](https://packagist.org/packages/google/auth) ^1.20
- [guzzlehttp/guzzle](https://packagist.org/packages/guzzlehttp/guzzle) ^7.0 fileciteturn1file3

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

[](#installation)

```
composer require aliamassi/fcm-notification dev-main
```

If you want to publish the configuration file, run:

```
php artisan vendor:publish --provider="AliAmassi\FcmNotification\FirebaseNotificationServiceProvider" --tag="config"
```

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

[](#configuration)

Copy your Firebase service account JSON to `storage/app/firebase-service-account.json` or set the path in your `.env`:

```
FIREBASE_CREDENTIALS=/full/path/to/firebase-service-account.json
FIREBASE_PROJECT_ID=your-firebase-project-id
```

The default config values are defined in config/fcm.php. After publishing, you can find the file at config/fcm.php.

Usage
-----

[](#usage)

Use the `FirebaseNotification` facade or inject `AliAmassi\FcmNotification\FirebaseClient`.

### Sending a Single Notification

[](#sending-a-single-notification)

```
use FirebaseNotification;

$response = FirebaseNotification::send(
    'device-token',
    [
      'title' => 'Hello',
      'body' => 'This is a test notification',
    ],
    [
      'foo' => 'bar'
    ]
);
```

### Sending to Multiple Devices

[](#sending-to-multiple-devices)

```
$tokens = ['token1', 'token2', 'token3'];

$response = FirebaseNotification::send(
    $tokens,
    ['title' => 'Batch Title', 'body' => 'Batch Body']
);
```

The client implementation handles obtaining and caching the access token via OAuth2 using your service account credentials fileciteturn1file5.

Publishing to Packagist
-----------------------

[](#publishing-to-packagist)

1. Tag your release:

    ```
    git tag v1.0.0
    git push --tags
    ```
2. Submit your repository on [Packagist](https://packagist.org/packages/submit).

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

[](#contributing)

Contributions are welcome! Please submit issues and pull requests.

License
-------

[](#license)

MIT License. See the [LICENSE](LICENSE) file.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

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/c6fdc54f5c5bc4c2a97ce2c23263f82a012f8147a21cc80c93d307eb9c7a0e93?d=identicon)[aliamassi](/maintainers/aliamassi)

---

Top Contributors

[![aliamassi](https://avatars.githubusercontent.com/u/56119326?v=4)](https://github.com/aliamassi "aliamassi (21 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/aliamassi-fcm-notification/health.svg)](https://phpackages.com/packages/aliamassi-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.3M228](/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)
