PHPackages                             jawabapp/cloud-messaging - 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. jawabapp/cloud-messaging

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

jawabapp/cloud-messaging
========================

1.1.10(1y ago)0428MITPHP

Since Jul 18Pushed 1y ago5 watchersCompare

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

READMEChangelog (10)Dependencies (4)Versions (73)Used By (0)

JawabApp CloudMessaging
=======================

[](#jawabapp-cloudmessaging)

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

[](#installation)

You can install the package via composer:

```
composer require jawabapp/cloud-messaging
```

Usage
-----

[](#usage)

###### User.php Model

[](#userphp-model)

```
use Jawabapp\CloudMessaging\Contracts\TargetAudience;
use Jawabapp\CloudMessaging\Traits\EloquentGetTableNameTrait;
use Jawabapp\CloudMessaging\Traits\HasTargetAudience;

class User extends Authenticatable implements TargetAudience
{
	use HasTargetAudience;
	use EloquentGetTableNameTrait;
	//...
}
```

implement those methods from TargetAudience interface.

```
use Illuminate\Database\Eloquent\Builder;

class User extends Authenticatable implements TargetAudience
{
	public static function targetAudienceForPhoneNumbers(Builder $query, $phone_numbers)
    {
        //...
    }

	public static function targetAudienceForOS(Builder $query, $os)
    {
        //...
    }
}
```

---

##### Adding more filters

[](#adding-more-filters)

###### User.php Model

[](#userphp-model-1)

```
public static function targetAudienceForCountries(Builder $query, $condition, $options, &$joins)
    {
        if ($condition === 'is_not_in') {
            $query->whereNotIn('phone_country', $options);
        } else {
            $query->whereIn('phone_country', $options);
        }
    }
```

###### cloud-messaging.php config file

[](#cloud-messagingphp-config-file)

```
'filter_types' => [
	[
            'value' => 'countries',
            'label' => 'Country/Region',
            'selectLabel' => 'Countries',
            'conditions' => [
                [
                    'value' => 'is_in',
                    'label' => 'Is in',
                ],
                [
                    'value' => 'is_not_in',
                    'label' => 'Is not in',
                ]
            ]
	],
	//...
]
```

###### web.php web route file

[](#webphp-web-route-file)

```
Route::group(['prefix' => env('JAWAB_CLOUD_MESSAGING_PATH', 'jawab-notifications')], function () {
    Route::group(['prefix' => 'api'], function () {
        Route::get('countries', 'Api\Admin\CountryController@index');
        //...
    });
});
```

###### CountryController.php web route file

[](#countrycontrollerphp-web-route-file)

```
public function index(Request $request)
{

    $mobile_os = $request->get('os');

    return User::select(['phone_country_code'])
        ->distinct()
        ->whereNotNull('phone_country_code')
        ->where('os', $mobile_os)
        ->get()
        ->map(function ($item) {
            return [
                'value' => $item->phone_country_code,
                'text' => $item->phone_country_code,
            ];
        });
}
```

---

##### change notifilable model

[](#change-notifilable-model)

###### cloud-messaging.php config file

[](#cloud-messagingphp-config-file-1)

```
[
	'notifiable_model' => \App\Models\User::class,
]
```

### 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)

- [Ahmed Magdy](https://github.com/ahmed-magdy-hassan)
- [Ibraheem Qanah](https://github.com/Qanah)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~20 days

Recently: every ~0 days

Total

58

Last Release

618d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/828ba8ba5dd4df2313e1b989e887ce0d7ded4fa81f2f7fee7bda33ed525a88ac?d=identicon)[jawabapp](/maintainers/jawabapp)

---

Top Contributors

[![Qanah](https://avatars.githubusercontent.com/u/9623559?v=4)](https://github.com/Qanah "Qanah (75 commits)")[![ahmed-magdy-hassan](https://avatars.githubusercontent.com/u/32437425?v=4)](https://github.com/ahmed-magdy-hassan "ahmed-magdy-hassan (49 commits)")[![jawabapp](https://avatars.githubusercontent.com/u/45000491?v=4)](https://github.com/jawabapp "jawabapp (13 commits)")[![Alaa-eta](https://avatars.githubusercontent.com/u/13734668?v=4)](https://github.com/Alaa-eta "Alaa-eta (11 commits)")[![GHB1985](https://avatars.githubusercontent.com/u/8342407?v=4)](https://github.com/GHB1985 "GHB1985 (2 commits)")[![unrealbato](https://avatars.githubusercontent.com/u/8654644?v=4)](https://github.com/unrealbato "unrealbato (1 commits)")

### Embed Badge

![Health badge](/badges/jawabapp-cloud-messaging/health.svg)

```
[![Health](https://phpackages.com/badges/jawabapp-cloud-messaging/health.svg)](https://phpackages.com/packages/jawabapp-cloud-messaging)
```

###  Alternatives

[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/apn

Apple APN Push Notification Channel

2021.9M4](/packages/laravel-notification-channels-apn)[laravel-notification-channels/microsoft-teams

A Laravel Notification Channel for Microsoft Teams

1603.0M7](/packages/laravel-notification-channels-microsoft-teams)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[guanguans/notify

Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

682104.9k7](/packages/guanguans-notify)[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)

PHPackages © 2026

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