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

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

tdx/notify-laravel
==================

send notifications from laravel

v2.0.2(4y ago)212.0k↓100%3[2 issues](https://github.com/TeraDox/Notify-Laravel/issues)MITPHPPHP &gt;=7.0

Since Oct 24Pushed 1y ago3 watchersCompare

[ Source](https://github.com/TeraDox/Notify-Laravel)[ Packagist](https://packagist.org/packages/tdx/notify-laravel)[ RSS](/packages/tdx-notify-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (26)Used By (0)

Notify-Laravel
==============

[](#notify-laravel)

A simple PHP package for sending notifications from laravel via [Slack](https://slack.com) with [incoming webhooks](https://my.slack.com/services/new/incoming-webhook) or via email. This package will automatically format an instance of exception object, string text, or an array for a message. While sending an exception as a message, it will attach an information of "user agent", "request uri", and "ip address. For Laravel, using this class in a Exceptions\\Handler.php class is prefered.

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

[](#requirements)

- PHP &gt;=7.0
- laravel/framework &gt;=5.3
- laravel/slack-notification-channel: "^2.3.1"

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

[](#installation)

### 1. Use composer to install this package.

[](#1-use-composer-to-install-this-package)

```
composer require tdx/notify-laravel

```

### 2. Add 'provider' and 'alias' for config\\app.php. (No need above Laravel 5.5. Thanks to Auto-Discovery feature! YaY)

[](#2-add-provider-and-alias-for-configappphp-no-need-above-laravel-55-thanks-to-auto-discovery-feature-yay)

```
'providers' => [ ...
        Notify\Laravel\NotifyServiceProvider::class,
        ...],

'aliases' => [ ...
        'Notify' => Notify\Laravel\Facades\Notify::class,
        ...],

```

### 3. Publish necessary config and view files.

[](#3-publish-necessary-config-and-view-files)

```
php artisan vendor:publish --tag='notify-laravel'

```

add `--force` option to overwrite previously published files.

These commands should create

```
/config/notify.php,
/resources/views/vendor/notify/mail.blade.php

```

If these publish commands does not work, try

```
php artisan config:clear

```

It will clear the config cache.

### 4. [Create an incoming webhook](https://my.slack.com/services/new/incoming-webhook) on your Slack account. You need to write Webhook URL in config\\slack.php file to send a message via Slack.

[](#4-create-an-incoming-webhook-on-your-slack-account-you-need-to-write-webhook-url-in-configslackphp-file-to-send-a-message-via-slack)

Settings
--------

[](#settings)

Write values for some config files.

### In config\\slack.php,

[](#in-configslackphp)

```
'endpoint'= (e.g.) 'https://hooks.slack.com/services/xxx/yyy/zzz' //webhook URL for your incoming webhook
'channel'= (e.g.) '#general' // channnel or username where you want to send a message. null for default
'username'= (e.g.) 'Robot' // username that is going to be displayed on the message. null for default
'link_names' = (e.g.) true // needs to be true to send with mention  '@here']); // sends an exception with mention.

```

- Sending messages from Instance.

```
$notify = new \Notify\Laravel\Notify(); // instance of Notify with default setting.
$notify->setTo($address); // change address. (channel or username for slack)
$notify->setFrom($username); // change username on the message.
$notify->setAdapter($adapter_name); // set adapter to 'slack' or 'mail'
$notify->send($content); // send message
// or use $notify->force($content) to force to send.

```

Options for Adapters
--------------------

[](#options-for-adapters)

For SlackAdapter,

ParameterTypeDescription`to`stringchannel or username that messages is going to be sent to.`from`stringusername for the message.`icon`stringThe icon URL or stamp string. (e.g.) `:smile:``fields`arrayhas UserAgent and RequestUri if there exist.`max_retry`boolmaximum number of retries. (default `max_retry = 3`)`force`boolforces to send if it is true. Otherwise, do not force (follows to config/active values).`mention`stringmention is attached at the beginning of the content. (e.g.) '@channel'`raw`boolsend text without formatting if it is true.For MailAdapter,

ParameterTypeDescription`to`stringemail address that messages is going to be sent to.`from`stringusername for the email. This does not need to be actual email address.`subject`stringsubject for the email.`fields`arrayhas UserAgent and RequestUri if there exist.`max_retry`boolmaximum number of retries. (default `max_retry = 3`)`force`boolforce to send if it is true. Otherwise, do not force (follow to active values).Example of Implementation using Laravel Exception Handler
---------------------------------------------------------

[](#example-of-implementation-using-laravel-exception-handler)

In App\\Exceptions\\Handler class,

```
use Notify\Laravel\Exception\NotifyException;

    public function report(Exception $exception)
    {
        if ($this->shouldntReport($e)) {
            return;
        }

        parent::report($exception);

        try {
            try {
                // Use Notify class here.
                \Notify::send($exception);  // Send with default settings.

            } catch (NotifyException $ne) {
                try {
                    // send via mail. (Another way to send a notification if first one failed.)
                    \Notify::send($ne, ['to' => 'YOUR_EMAIL_ADDRESS'], 'mail');
                    parent::report($ne);
                } catch (NotifyException $ne2) {
                    // Problem of mail settings. Dont't use Notify class here to avoid loop.
                    parent::report($ne2);
                }
            }
        } catch (Exception $e) {
            // Notify class should throw only NotifyException, but just in case, catch other Exception here to avoid loop.
            parent::report($e);
        }
    }

```

How to Create Other Adapter
---------------------------

[](#how-to-create-other-adapter)

1. Create a class which implements AdapterInterface in an Adapters folder.
2. Name the class to xxxAdapter. xxx will be an adapter name that is going to be called.
3. Modify config/config.php file to define default values for the adapter.

Notes
-----

[](#notes)

If an adapter failed to send a message, it will automatically retry to send it. Write \['max\_retry' = SOME\_NUMBER\] in the options array to change the number of attempts (default max\_retry = 3). If all attempts failed, it will throw NotifyException. To get more specific info about the error, you should check laravel.log file (The log file captures errors for all attempts).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~72 days

Recently: every ~269 days

Total

24

Last Release

1811d ago

Major Versions

v1.5.30 → v2.0.12021-05-25

PHP version history (2 changes)v1.0.0PHP &gt;=5.6.4

v2.0.1PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c71a634552e2be9f36649d7c3cc1050aacff58ff9b0e00a8f3c46509a3ac039c?d=identicon)[tdx-rikeda](/maintainers/tdx-rikeda)

![](https://www.gravatar.com/avatar/9ce283f73bbb731de3c459f61bd74245ba007ef37ff54449749986b9d79fa9b1?d=identicon)[Taro-fujishima](/maintainers/Taro-fujishima)

![](https://www.gravatar.com/avatar/425241884c1006598a8f43c35456dc792945e9a36db0f79f2b43b91e53e73dee?d=identicon)[suzuya-kaoru](/maintainers/suzuya-kaoru)

---

Top Contributors

[![yousan](https://avatars.githubusercontent.com/u/561613?v=4)](https://github.com/yousan "yousan (1 commits)")

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-failed-job-monitor

Get notified when a queued job fails

1.0k2.6M4](/packages/spatie-laravel-failed-job-monitor)[vemcogroup/laravel-sparkpost-driver

SparkPost driver to use with Laravel 6.x|7.x|8.x|9.x|10.x

421.7M1](/packages/vemcogroup-laravel-sparkpost-driver)[spatie/mailcoach

Self-host Mailcoach

4007.0k](/packages/spatie-mailcoach)[synergitech/laravel-postal

This library integrates Postal with the standard Laravel mail framework.

38107.1k](/packages/synergitech-laravel-postal)[motomedialab/smtp2go

Send emails via API using the first-class email courier SMTP2Go

1316.3k](/packages/motomedialab-smtp2go)

PHPackages © 2026

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