PHPackages                             notify-eu/notify - 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. notify-eu/notify

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

notify-eu/notify
================

Notify Notifications driver for Laravel

v1.0(6y ago)023MITPHPPHP ^7.2

Since Aug 5Pushed 6y agoCompare

[ Source](https://github.com/notify-eu/notify)[ Packagist](https://packagist.org/packages/notify-eu/notify)[ Docs](https://github.com/notify-eu)[ RSS](/packages/notify-eu-notify/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (7)Versions (5)Used By (0)

Notify notifications channel for Laravel 5.7+ &amp; 6.x
=======================================================

[](#notify-notifications-channel-for-laravel-57--6x)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5c56b80b15b4b242f67fb2e02c29c95e2e31fcdfe1612721e2438cc9d7faa1a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f746966792d65752f6e6f746966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/notify-eu/notify)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/33acc7e845612138d766c88cea76ec34d16046e6bea8d26267b0a498f1233935/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e6f746966792d65752f6e6f746966792f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/notify-eu/notify)[![StyleCI](https://camo.githubusercontent.com/539efbdd7a93f1310d55059879794435f02a18beffbe67b69462b8f2adcafe8f/68747470733a2f2f7374796c6563692e696f2f7265706f732f3230303634363031362f736869656c64)](https://styleci.io/repos/200646016)[![Total Downloads](https://camo.githubusercontent.com/d79a26704d015c9ad18e397f19edb7fb2fc45c08a9027e35f68cf2c2586db6a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f746966792d65752f6e6f746966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/notify-eu/notify)

This package makes it easy to send notifications using [Notify](https://notify.eu) with Laravel 5.7+ &amp; 6.x

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up your Notify account](#setting-up-your-notify-account)
- [Usage](#usage)
    - [Available Message methods](#all-available-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
$ composer require notify-eu/notify
```

### Setting up your Notify account

[](#setting-up-your-notify-account)

Add your ClientId, secret and transport to your `config/services.php`:

`NOTIFY_URL` is not mandatory. Can be used when you want to overwrite the endpoint Notify is calling. (f.e. different url for Staging/production)

```
// config/services.php
...
''notify' => [
         'clientID' => env('NOTIFY_CLIENT_ID'),
         'secret' => env('NOTIFY_SECRET'),
         'transport' => env('NOTIFY_TRANSPORT'),
         'url' => env('NOTIFY_URL')
],
...
```

Add your Notify credentials to your `.env`:

```
// .env
...
NOTIFY_CLIENT_ID=
NOTIFY_SECRET=
NOTIFY_TRANSPORT=
NOTIFY_URL=
],
...
```

Usage
-----

[](#usage)

Now you can use the channel in your `via()` method inside the notification:

```
use App\User;
use Illuminate\Notifications\Notification;
use NotifyEu\Notify\NotifyChannel;
use NotifyEu\Notify\NotifyMessage;

class InvoicePaid extends Notification
{
    const TYPE = 'buyerContractApproval';
    protected $user;
    private $cc = [];
    private $bcc = [];

    /**
     * InvoicePaid constructor.
     * @param User $user
     */
    public function __construct(User $user)
    {
        $this->user = $user;
    }

    /**
     * @param $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return [NotifyChannel::class];
    }

    /**
     * @param $notifiable
     * @return NotifyMessage
     */
    public function toNotify($notifiable)
    {
        return NotifyMessage::create()
            ->setNotificationType(self::TYPE)
            ->setTransport('mail')
            ->setLanguage('en')
            ->setParams($this->getParams())
            ->setCc($this->cc)
            ->setBcc($this->bcc);
    }

    /**
     * @return array
     */
    private function getParams()
    {
        return array('userToken' => $this->user->getRememberToken());
    }

    /**
     * @param array $cc
     * format: array(array('name' => 'John Doe', 'recipient' => 'john@doe.com')
     */
    public function addCc(array $cc)
    {
        $this->cc = $cc;
    }

    /**
     * @param array $bcc
     * format: array(array('name' => 'John Doe', 'recipient' => 'john@doe.com')
     */
    public function addBcc(array $bcc)
    {
        $this->bcc = $bcc;
    }
```

### Notifiable

[](#notifiable)

Make sure the notifiable model has the following method:

```
/**
 * Route notifications for the notify channel.
 *
 * @return string
 */
public function routeNotificationForNotify()
{
    return [
        'name' => $this->name,
        'recipient' => $this->email,
    ];
}
```

### All available methods

[](#all-available-methods)

- `notificationType('')`: Accepts a string value.
- `transport('')`: Accepts a string value. if not set, it will fallback to NOTIFY\_TRANSPORT in .env file
- `language('')`: Accepts a string value.
- `params($array)`: Accepts an array of key/value parameters
- `Cc($array)`: Accepts an array of arrays of 'name'/'recipient' keys
- `Bcc($array)`: Accepts an array of arrays of 'name'/'recipient' keys

Events
------

[](#events)

Following events are triggered by Notification. By default:

- Illuminate\\Notifications\\Events\\NotificationSending
- Illuminate\\Notifications\\Events\\NotificationSent

and this channel triggers one when a call to Notify fails for any reason:

- Illuminate\\Notifications\\Events\\NotificationFailed

To listen to those events create event listeners in `app/Listeners`:

```
namespace App\Listeners;

use Illuminate\Notifications\Events\NotificationFailed;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Log;
use NotifyEu\Notify\NotifyChannel;

class NotificationFailedListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Notification failed event handler
     *
     * @param  NotificationFailed  $event
     * @return void
     */
    public function handle(NotificationFailed $event)
    {
        // Handle fail event for Notify
        //
        if($event->channel == NotifyChannel::class) {

            $logData = [
            	'notifiable'    => $event->notifiable->id,
            	'notification'  => get_class($event->notification),
            	'channel'       => $event->channel,
            	'data'      => $event->data
            	];

            Log::error('Notification Failed', $logData);
         }
    }
}
```

Then register listeners in `app/Providers/EventServiceProvider.php`

```
...
protected $listen = [

	'Illuminate\Notifications\Events\NotificationFailed' => [
		'App\Listeners\NotificationFailedListener',
	],

	'Illuminate\Notifications\Events\NotificationSent' => [
		'App\Listeners\NotificationSentListener',
	],
];
...
```

Changelog
---------

[](#changelog)

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

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

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

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

[](#contributing)

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

Credits
-------

[](#credits)

- [notify](https://github.com/notify-eu)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2287d ago

### Community

Maintainers

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

---

Tags

laravel-packagenotificationslaravelnotificationnotifynotify notifications channel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/notify-eu-notify/health.svg)

```
[![Health](https://phpackages.com/badges/notify-eu-notify/health.svg)](https://phpackages.com/packages/notify-eu-notify)
```

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[s-ichikawa/laravel-sendgrid-driver

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

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[gr8shivam/laravel-sms-api

A modern, flexible Laravel package for integrating any SMS gateway with REST API support

10138.4k](/packages/gr8shivam-laravel-sms-api)[ghanem/laravel-smsmisr

Send SMS and SMS Notification via SMS Misr for Laravel

194.8k](/packages/ghanem-laravel-smsmisr)

PHPackages © 2026

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