PHPackages                             eluhr/yii2-notification-module - 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. eluhr/yii2-notification-module

ActiveYii2-extension[Mail &amp; Notifications](/categories/mail)

eluhr/yii2-notification-module
==============================

A notification module for Yii2

1.3.11(3mo ago)214.9k↑183.3%2BSD-3-ClausePHP

Since Jul 12Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/eluhr/yii2-notification-module)[ Packagist](https://packagist.org/packages/eluhr/yii2-notification-module)[ RSS](/packages/eluhr-yii2-notification-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (7)Versions (38)Used By (0)

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

[](#installation)

```
composer require eluhr/yii2-notification-module
```

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

[](#configuration)

```
use eluhr\notification\components\Notification as NotificationComponent;
use eluhr\notification\Module as NotificationModule;
...
'modules' => [
    'notification' => [
        'class' => NotificationModule::class,
        // Optional: Override the list of possible message recipients
        // 'possibleUsersCallback' => function() {
        //     return \yii\helpers\ArrayHelper::map(
        //         \Da\User\Model\User::find()->where(['blocked_at' => null])->all(),
        //         'id',
        //         'username'
        //     );
        // },
    ],
    'translatemanager' => [
        'root' => [
            '@vendor/eluhr/yii2-notification-module/src'
        ]
    ]
],
'components' => [
    'notification' => [
        'class' => NotificationComponent::class,
        'mailer' => 'mailer', // OPTIONAL: Default -> mailer
        'fromEmail' => 'notifications@domain.com' // REQUIRED
    ]
],
'controllerMap' => [
    'migrate' => [
        'migrationPath' => [
            '@vendor/eluhr/yii2-notification-module/src/migrations',
        ]
    ]
]
...
```

Example
-------

[](#example)

Inbox from the point of view of a user with all authorizations [![Example inbox](./docs/images/inbox.png)](./docs/images/inbox.png)

Write a message to individual users or entire user groupsSearch messages by subject, author or text[![Compse message](./docs/images/compose-a-new-message.png)](./docs/images/compose-a-new-message.png)[![Filtered inbox](./docs/images/filtered-inbox.png)](./docs/images/filtered-inbox.png)Group users to create your own personal user groupsMark, read or delete messages[![User group](./docs/images/user-groups.png)](./docs/images/user-groups.png)[![User group](./docs/images/message-options.png)](./docs/images/message-options.png)### Worth knowing

[](#worth-knowing)

Requires PHP version &gt;= 7.\*

Example usuage
--------------

[](#example-usuage)

```
ExampleModel extends ActiveRecord implements ModelChangeNotification {

        /**
         * @return array
         */
        public function behaviors()
        {
            $behaviors = parent::behaviors();
            $behaviors['notification'] = [
                'class' => ModelChangeNotification::class,
                'receiverIds' => [MessageUserGroup::MESSAGE_USER_GROUP_ID_PREFIX . '1']
            ];
            return $behaviors;
        }

        /**
         * @return string
         */
        public function subject()
        {
            return $this->isNewRecord ? 'New entry' : ('Updated entry #' . $this->id);
        }

        /**
         * @return string
         */
        public function text()
        {
            $text = Html::tag('pre', htmlentities(json_encode($this->attributes, JSON_PRETTY_PRINT)));
            $text .= Html::tag('p', Html::a('Direct link',['/widgets/crud/widget-template/view','id' => $this->id], true));
            return $text;
        }

}
```

More infos coming soon

Ideas
-----

[](#ideas)

The following stuff will probably come in a future release

- Draft messages for later use
- Ability to remove messages
- Mark messages from users with a label or something
- Notification Widget (AdminLTE)
- Delete (inbox) message in overview (three dots option edit)
- Translation config

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance80

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 83% 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 ~75 days

Recently: every ~188 days

Total

33

Last Release

105d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/07b2ebef20cf3f8b95894ff50fdb0ba46cf04c8d74ffbb6a4e724af8569a8aec?d=identicon)[eluhr](/maintainers/eluhr)

---

Top Contributors

[![eluhr](https://avatars.githubusercontent.com/u/13000805?v=4)](https://github.com/eluhr "eluhr (39 commits)")[![a-klapper](https://avatars.githubusercontent.com/u/54941040?v=4)](https://github.com/a-klapper "a-klapper (4 commits)")[![H-Algabri](https://avatars.githubusercontent.com/u/100204087?v=4)](https://github.com/H-Algabri "H-Algabri (3 commits)")[![amk0](https://avatars.githubusercontent.com/u/7900784?v=4)](https://github.com/amk0 "amk0 (1 commits)")

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/eluhr-yii2-notification-module/health.svg)

```
[![Health](https://phpackages.com/badges/eluhr-yii2-notification-module/health.svg)](https://phpackages.com/packages/eluhr-yii2-notification-module)
```

###  Alternatives

[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)[eduardokum/laravel-mail-auto-embed

Library for embed images in emails automatically

1702.0M5](/packages/eduardokum-laravel-mail-auto-embed)[netflie/laravel-notification-whatsapp

Laravel notification driver for WhatsApp

176173.9k](/packages/netflie-laravel-notification-whatsapp)

PHPackages © 2026

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