PHPackages                             medianet-dev/cloud-message - 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. medianet-dev/cloud-message

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

medianet-dev/cloud-message
==========================

A Laravel package for sending Firebase and Huawei notifications.

1.2.1(1mo ago)02633MITPHPPHP ^8.1CI passing

Since Sep 17Pushed 1mo agoCompare

[ Source](https://github.com/Medianet-Tunisia/cloud-message)[ Packagist](https://packagist.org/packages/medianet-dev/cloud-message)[ Docs](https://github.com/medianet-dev/cloud-message)[ RSS](/packages/medianet-dev-cloud-message/feed)WikiDiscussions main Synced today

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

Cloud Message
=============

[](#cloud-message)

[![](https://camo.githubusercontent.com/2551687e1f0614936b5d7ba82ce571bac447f75aa882aca5fec9e12cfa4e347b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d656469616e65742d6465762f636c6f75642d6d6573736167652e7376673f6c6f676f3d636f6d706f736572)](https://packagist.org/packages/medianet-dev/cloud-message "Latest Version on Packagist")[![](https://camo.githubusercontent.com/ccd577f310e89f6fd4eb120291a5262386eaf919923e374888fe4f5cb03f6c38/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f4d656469616e65742d54756e697369612f636c6f75642d6d6573736167652e7376673f623d6d61696e)](https://scrutinizer-ci.com/g/Medianet-Tunisia/cloud-message "Quality Score")[![](https://camo.githubusercontent.com/ae44bdc865224a39e0d2ac773ef7c792681fb41cb177ef479274e452ad867cac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d656469616e65742d6465762f636c6f75642d6d6573736167652e737667)](https://packagist.org/packages/medianet-dev/cloud-message "Total Downloads")

---

Cloud Message is a Laravel package that provides a simple and unified way to send push notifications using Firebase Cloud Messaging (FCM) and Huawei Push Kit.

Features
--------

[](#features)

- Send push notifications via Firebase Cloud Messaging (FCM)
- Send push notifications via Huawei Push Kit
- Unified API for both FCM and Huawei
- Easy to use Facade
- Customizable configuration
- Robust error handling

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

[](#requirements)

- PHP 8.1+
- Laravel 9.x – 13.x

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

[](#installation)

You can install the package via composer:

```
composer require medianet-dev/cloud-message
```

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

[](#configuration)

After installation, publish the config file:

```
php artisan vendor:publish --provider="MedianetDev\CloudMessage\CloudMessageServiceProvider" --tag="config"
```

This will create a `config/cloud_message.php` file in your app's configuration directory. Here you can set your Firebase and Huawei credentials.

Usage
-----

[](#usage)

### Using the Facade

[](#using-the-facade)

You can use the `CloudMessage` facade to send notifications:

```
use MedianetDev\CloudMessage\Facade\CloudMessage;

$message = [
    'title' => "Your notification title",
    'body' => "Your notification body",
];

$registrationTokens = [
    'token1',
    'token2'
];

// Send to Android devices
$results = CloudMessage::sendToTokens($message, $registrationTokens, 'android');

// Send to iOS devices
$results = CloudMessage::sendToTokens($message, $registrationTokens, 'ios');

// Send to Huawei devices
$results = CloudMessage::sendToTokens($message, $registrationTokens, 'huawei');
```

### Send to specific devices without using the Facade

[](#send-to-specific-devices-without-using-the-facade)

You can also use the notification class directly:

```
use MedianetDev\CloudMessage\Drivers\FirebaseNotification;
use MedianetDev\CloudMessage\Drivers\HuaweiNotification;

$message = [
    'title' => "Your notification title",
    'body' => "Your notification body",
];

$registrationTokens = [
    'token1',
    'token2'
];

$results = FirebaseNotification::sendToTokens($message, $registrationTokens);
$results = HuaweiNotification::sendToTokens($message, $registrationTokens);
```

### Subscribe to a Topic

[](#subscribe-to-a-topic)

```
use MedianetDev\CloudMessage\Facade\CloudMessage;

$topic = 'guests';
$registrationTokens = [
    'token1',
    'token2'
];

$results = CloudMessage::subscribeToTopic($topic, $registrationTokens, 'ios');
```

This will subscribe the provided tokens to receive notifications for the given topic.

### Send to a Topic

[](#send-to-a-topic)

```
use MedianetDev\CloudMessage\Facade\CloudMessage;

$message = [
    'title' => "Your notification title",
    'body' => "Your notification body",
];

$topic = 'guests';

// Send to Android devices
$results = CloudMessage::sendToTopic($message, $topic, 'android');

// Send to iOS devices
$results = CloudMessage::sendToTopic($message, $topic, 'ios');

// Send to Huawei devices
$results = CloudMessage::sendToTopic($message, $topic, 'huawei');
```

This will send the notification to all devices subscribed to the given topic.

### Unsubscribe to a Topic

[](#unsubscribe-to-a-topic)

```
use MedianetDev\CloudMessage\Facade\CloudMessage;

$topic = 'guests';
$registrationTokens = [
    'token1',
    'token2'
];

// Unsubscribe Android devices
$results = CloudMessage::unsubscribeToTopic($topic, $registrationTokens, 'android');

// Unsubscribe iOS devices
$results = CloudMessage::unsubscribeToTopic($topic, $registrationTokens, 'ios');
```

Removes the subscription of the tokens from the given topic.

### Configuration for Asynchronous Requests

[](#configuration-for-asynchronous-requests)

For performance optimizations when sending notifications to large numbers of tokens, the package supports asynchronous multi-token requests.

To enable this feature, configure the `async_requests` option in the config file:

```
return [
    // Other configurations...

    'async_requests' => env('CLOUD_MESSAGE_ASYNC_REQUESTS', false),
];
```

You will need to ensure your queue worker is running to process these asynchronous jobs. From the command line, run: `php artisan queue:work`

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Adel Stiti](https://github.com/adelstiti)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance89

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.2% 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.

###  Release Activity

Cadence

Every ~100 days

Recently: every ~145 days

Total

7

Last Release

53d ago

PHP version history (2 changes)1.0.0PHP ^7.3|^8.0

1.2.1PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/30412331?v=4)[MaherMehri](/maintainers/MaherMehri)[@MaherMehri](https://github.com/MaherMehri)

![](https://www.gravatar.com/avatar/2eb9bdda1104ed71dc2dcad92dac5a10e3cee1866b73968e74b98cdb70392e2d?d=identicon)[medianet-dev](/maintainers/medianet-dev)

![](https://www.gravatar.com/avatar/82f3e9f3252c687e1a38e41413c9439ff4993ecee0cd02a192bbc127921d9dcb?d=identicon)[adelstiti](/maintainers/adelstiti)

---

Top Contributors

[![adelstiti](https://avatars.githubusercontent.com/u/40324627?v=4)](https://github.com/adelstiti "adelstiti (19 commits)")[![medianet-dev](https://avatars.githubusercontent.com/u/57226389?v=4)](https://github.com/medianet-dev "medianet-dev (5 commits)")

---

Tags

laravelpushnotificationfirebaseFCMpriorityhighmedianet-devcloud-message

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/medianet-dev-cloud-message/health.svg)

```
[![Health](https://phpackages.com/badges/medianet-dev-cloud-message/health.svg)](https://phpackages.com/packages/medianet-dev-cloud-message)
```

###  Alternatives

[edujugon/push-notification

Laravel Package to send push notifications to Android and IOS devices. (GCM,FCM,APN)

4891.5M1](/packages/edujugon-push-notification)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
