PHPackages                             namshi/notificator - 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. namshi/notificator

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

namshi/notificator
==================

A lightweight library to handle notifications the smart way.

5.1.1(7y ago)193238.9k↑28.3%262MITPHP

Since Jul 10Pushed 7y ago45 watchersCompare

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

READMEChangelogDependencies (8)Versions (29)Used By (2)

NAMSHI | Notificator
====================

[](#namshi--notificator)

[![Build Status](https://camo.githubusercontent.com/ff273d4acb85090e058b8ba98a5c6d229f47fbc287a8dd415eece80b3cdcf500/68747470733a2f2f7472617669732d63692e6f72672f6e616d7368692f6e6f746966696361746f722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/namshi/notificator)

[![SensioLabsInsight](https://camo.githubusercontent.com/37ac6000a11cc8659f7be608f79c7501281dfd4efa871e18d12854bfa69c9ca6/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62333733643666652d623661302d346164322d613132652d6663326537383861373963322f6d696e692e706e67)](https://insight.sensiolabs.com/projects/b373d6fe-b6a0-4ad2-a12e-fc2e788a79c2)

*Notificator* is a very simple and lightweight library to handle notifications the smart way.

It took inspiration from other libraries and patterns (Monolog and event dispatching) in order to provide a domain-driven lean notification library.

Concepts are very simple: you have a notification **Manager** which has a few handlers registered with it (maybe an **Email** handler, a **Skype** handler, etc.); you only have to create a notification class, define which handlers should handle it and trigger it through the manager.

It is way simpler in code than in words, check the documentation below!

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

[](#installation)

Installation can be done via composer, as the library is already on [packagist](https://packagist.org/packages/namshi/notificator).

The library uses semantic versioning for its API, so it is recommended to use a stable minor version (1.0, 1.1, etc.) and stick to it when declaring dependencies through composer:

```
"namshi/notificator": "1.0.*",

```

Usage
-----

[](#usage)

Using this library is very easy thanks to the simple concept - borrowed from others - behind it: you basically have a notification manager with some handlers and then you fire (`trigger()`) the notification with the manager. At that point, all the handlers that need to fire that notification will take care of firing it in their context (might be an email, a skype message, etc) and tell the manager that they're done, so that the manager can forward the notification to the next handler.

```
