PHPackages                             kevincobain2000/laravel-alert-notifications - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. kevincobain2000/laravel-alert-notifications

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

kevincobain2000/laravel-alert-notifications
===========================================

Alert notifications of exceptions from your laravel application

6.2(9mo ago)2621.1k↓44.4%9[1 PRs](https://github.com/kevincobain2000/laravel-alert-notifications/pulls)MITPHPPHP ^7.3|^8.0CI passing

Since Jan 21Pushed 9mo ago3 watchersCompare

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

READMEChangelog (10)Dependencies (6)Versions (28)Used By (0)

 Laravel Alert Notifcations
============================

[](#--laravel-alert-notifcations)

 Send php exceptions to email, microsoft teams, slack.
 Notifications are throttle enabled so devs don't get a lot of emails from one host
 (or all hosts if cache driver is shared).

[![All Contributors](https://camo.githubusercontent.com/ca88cf3830da504bd3c0bc15c2a99ce41326509bc2f02132398a881adc22b659/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f616c6c5f636f6e7472696275746f72732d362d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](#contributors-)

ChannelsProgressEmailSupportedMicrosoft TeamsSupportedSlackSupportedPager DutySupported### Installation

[](#installation)

```
composer require kevincobain2000/laravel-alert-notifications

```

> If you're using Laravel 5.5+ let the package auto discovery make this for you.

```
'providers' => [
    \Kevincobain2000\LaravelAlertNotifications\AlertNotificationsServiceProvider::class
]

```

### Tests

[](#tests)

```
composer install
composer run test

```

### Publish (Laravel)

[](#publish-laravel)

```
php artisan vendor:publish --provider="Kevincobain2000\LaravelAlertNotifications\AlertNotificationsServiceProvider"
php artisan config:cache

```

### Publish (Lumen)

[](#publish-lumen)

Since Lumen doesn't support auto-discovery, move config and view files to the destination directories manually

```
cp vendor/kevincobain2000/laravel-alert-notifications/src/config/laravel_alert_notifications.php config/laravel_alert_notifications.php
mkdir -p "resources/views/vendor/laravel_alert_notifications/" && cp vendor/kevincobain2000/laravel-alert-notifications/src/views/* resources/views/vendor/laravel_alert_notifications/
```

and add the following to bootstrap/app.php:

```
$app->register(Kevincobain2000\LaravelAlertNotifications\AlertNotificationsServiceProvider::class);
```

### .env

[](#env)

```
ALERT_NOTIFICATION_MAIL_FROM_ADDRESS=
ALERT_NOTIFICATION_MAIL_TO_ADDRESS=
ALERT_NOTIFICATION_MAIL_NOTICE_TO_ADDRESS=
ALERT_NOTIFICATION_MAIL_WARNING_TO_ADDRESS=
ALERT_NOTIFICATION_MAIL_ERROR_TO_ADDRESS=
ALERT_NOTIFICATION_MAIL_CRITICAL_TO_ADDRESS=
ALERT_NOTIFICATION_MAIL_ALERT_TO_ADDRESS=
ALERT_NOTIFICATION_MAIL_EMERGENCY_TO_ADDRESS=
ALERT_NOTIFICATION_CACHE_DRIVER=file
ALERT_NOTIFICATION_MICROSOFT_TEAMS_WEBHOOK=
ALERT_NOTIFICATION_SLACK_WEBHOOK=
ALERT_NOTIFICATION_PAGER_DUTY_INTEGRATION_KEY=
ALERT_NOTIFICATION_CURL_PROXY=

```

### Usage

[](#usage)

```
new AlertDispatcher(
    Exception $e
    [, array $dontAlertExceptions = []]         // Exceptions that shouldn't trigger notifications
    [, array $notificationLevelsMapping = []]   // [Exception class => Notification level] mapping
    [, array $exceptionContext = []]            // Array of context data
)
```

In **app/Exceptions/Handler.php**. It is better to use a try catch to prevent loop.

```
use Kevincobain2000\LaravelAlertNotifications\Dispatcher\AlertDispatcher;

class Handler extends ExceptionHandler
{
    private $exceptionLogLevels = [
        DebugLevelException::class => LogLevel::DEBUG,
        WarningLevelException::class => LogLevel::WARNING,
        ErrorLevelException::class => LogLevel::ERROR,
    ];

    protected $dontReport = [
        //
    ];

    public function report(Throwable $exception)
    {
        try {
            $dontReport = array_merge($this->dontReport, $this->internalDontReport);
            $alertDispatcher = new AlertDispatcher($exception, $dontReport, $this->exceptionLogLevels);
            $alertDispatcher->notify();
        } catch (Throwable $e) {
            // log any unexpected exceptions or do nothing
        }
        parent::report($exception);
    }
}
```

### Config

[](#config)

config/env keypurposethrottle\_enabled(default true) If false then library will send alerts without any throttlingthrottle\_duration\_minutes(default 5 mins) If an exception has been notifiedThis will next notify after 5 mins when same exception occurscache\_prefixThis is a prefix for cache key. Your cache key will look like`laravel-alert-notifications-ExceptionClass-ExceptionCode`ALERT\_NOTIFICATION\_CURL\_PROXYIf your slack/MS teams require proxy, then set it up accordinglydefault\_notification\_levelDefault notification levelexclude\_notification\_levelsDo not send notification if it is of one of the listed levelmailE-mail config array:mail.enabled(default true), false will not notify to emailmail.fromAddress(default null), null will not notify to emailmail.toAddressDefault recipient e-mail addressmail.subjectDefault e-mail subject. May contain placeholders replaced afterwards withcorrespondent exception data:`%ExceptionMessage%` =&gt; `$e->getMessage()``%ExceptionCode%` =&gt; `$e->getCode()``%ExceptionType%` =&gt; `$e->getType()``%ExceptionLevel%` =&gt; `current notification level`ex. `'subject' => 'Exception [%ExceptionType%] has ocurred`'mail.#level#Configs for each notification levelnotification levels refer to those defined in `\Psr\Log\LogLevel`mail.#level#.toAddress(default mail.to\_address), #level# notification recipient e-mailmail.#level#.subject\#level# notification e-mail subjectmicrosoft\_teams.enabled(default true), false will not notify to teamsmicrosoft\_teams.webhook(default null), null will not notify to teamsslack.enabled(default true), false will not notify to slackslack.webhook(default null), null will not notify to slackpager\_duty.enabled(default true), false will not notify to pager dutypager\_duty.events\_v2\_endpoint(default ), should not need to change thispager\_duty.integration\_key(default null), null with not notify to pager duty### Samples

[](#samples)

#### Email

[](#email)

[![Email](./docs/img/mail.png)](./docs/img/mail.png)

#### Teams

[](#teams)

[![Teams](./docs/img/microsoft-teams.png)](./docs/img/microsoft-teams.png)

#### Slack

[](#slack)

[![Slack](./docs/img/slack.png)](./docs/img/slack.png)

#### Pager Duty

[](#pager-duty)

[![Pager Duty](./docs/img/pager-duty.png)](./docs/img/pager-duty.png)

### References

[](#references)

1.
2.

Contributors ✨
--------------

[](#contributors-)

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

  [![](https://avatars0.githubusercontent.com/u/7387512?v=4)
**Aaron Brigham**](http://www.abrigham.com)
[⚠️](https://github.com/kevincobain2000/laravel-alert-notifications/commits?author=abrigham1 "Tests") [💻](https://github.com/kevincobain2000/laravel-alert-notifications/commits?author=abrigham1 "Code") [![](https://avatars1.githubusercontent.com/u/6893843?v=4)
**Alexander Hupe**](https://github.com/AlexHupe)
[👀](https://github.com/kevincobain2000/laravel-alert-notifications/pulls?q=is%3Apr+reviewed-by%3AAlexHupe "Reviewed Pull Requests") [⚠️](https://github.com/kevincobain2000/laravel-alert-notifications/commits?author=AlexHupe "Tests") [💻](https://github.com/kevincobain2000/laravel-alert-notifications/commits?author=AlexHupe "Code") [![](https://avatars2.githubusercontent.com/u/7660346?v=4)
**Kit Loong**](https://github.com/kitloong)
[👀](https://github.com/kevincobain2000/laravel-alert-notifications/pulls?q=is%3Apr+reviewed-by%3Akitloong "Reviewed Pull Requests") [⚠️](https://github.com/kevincobain2000/laravel-alert-notifications/commits?author=kitloong "Tests") [💻](https://github.com/kevincobain2000/laravel-alert-notifications/commits?author=kitloong "Code") [![](https://avatars1.githubusercontent.com/u/1041215?v=4)
**Andrew Miller**](http://www.standingmist.com)
[👀](https://github.com/kevincobain2000/laravel-alert-notifications/pulls?q=is%3Apr+reviewed-by%3Aikari7789 "Reviewed Pull Requests") [⚠️](https://github.com/kevincobain2000/laravel-alert-notifications/commits?author=ikari7789 "Tests") [💻](https://github.com/kevincobain2000/laravel-alert-notifications/commits?author=ikari7789 "Code") [![](https://avatars2.githubusercontent.com/u/629055?v=4)
**Pulkit Kathuria**](https://kevincobain2000.github.io)
[👀](https://github.com/kevincobain2000/laravel-alert-notifications/pulls?q=is%3Apr+reviewed-by%3Akevincobain2000 "Reviewed Pull Requests") [⚠️](https://github.com/kevincobain2000/laravel-alert-notifications/commits?author=kevincobain2000 "Tests") [💻](https://github.com/kevincobain2000/laravel-alert-notifications/commits?author=kevincobain2000 "Code") [![](https://avatars0.githubusercontent.com/u/49443783?v=4)
**Masashi**](https://github.com/masashi1014)
[⚠️](https://github.com/kevincobain2000/laravel-alert-notifications/commits?author=masashi1014 "Tests") This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance56

Moderate activity, may be stable

Popularity38

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity78

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

Recently: every ~224 days

Total

27

Last Release

292d ago

Major Versions

1.2.1 → 2.22019-03-11

2.5 → 3.02019-03-31

3.2 → 4.02019-12-03

4.4 → 5.02020-03-10

5.5 → 6.02024-07-21

PHP version history (3 changes)1.0.0PHP &gt;=5.4.0

2.2PHP &gt;=7.0.0

5.4PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c550bc7dd7e314f127ded1da50624d7405ce2a5f9b005a8ed52fcb09e489022?d=identicon)[kevincobain2000](/maintainers/kevincobain2000)

---

Top Contributors

[![kevincobain2000](https://avatars.githubusercontent.com/u/629055?v=4)](https://github.com/kevincobain2000 "kevincobain2000 (72 commits)")[![andrew-miller-rakuten](https://avatars.githubusercontent.com/u/159877857?v=4)](https://github.com/andrew-miller-rakuten "andrew-miller-rakuten (59 commits)")[![abrigham1](https://avatars.githubusercontent.com/u/7387512?v=4)](https://github.com/abrigham1 "abrigham1 (22 commits)")[![allcontributors[bot]](https://avatars.githubusercontent.com/in/23186?v=4)](https://github.com/allcontributors[bot] "allcontributors[bot] (12 commits)")[![kitloong](https://avatars.githubusercontent.com/u/7660346?v=4)](https://github.com/kitloong "kitloong (8 commits)")[![masashi1014](https://avatars.githubusercontent.com/u/49443783?v=4)](https://github.com/masashi1014 "masashi1014 (5 commits)")[![AlexHupe](https://avatars.githubusercontent.com/u/6893843?v=4)](https://github.com/AlexHupe "AlexHupe (4 commits)")[![persimm0n](https://avatars.githubusercontent.com/u/58250541?v=4)](https://github.com/persimm0n "persimm0n (4 commits)")[![mattusik](https://avatars.githubusercontent.com/u/1252223?v=4)](https://github.com/mattusik "mattusik (3 commits)")[![rakuten-kitloong](https://avatars.githubusercontent.com/u/141610967?v=4)](https://github.com/rakuten-kitloong "rakuten-kitloong (3 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![ikari7789](https://avatars.githubusercontent.com/u/1041215?v=4)](https://github.com/ikari7789 "ikari7789 (1 commits)")

---

Tags

alertsemaillaravelmicrosoft-teamsmonitoringslackthrottlelaravelemaildebuggingexceptionlaravel-packageexception handling

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/kevincobain2000-laravel-alert-notifications/health.svg)

```
[![Health](https://phpackages.com/badges/kevincobain2000-laravel-alert-notifications/health.svg)](https://phpackages.com/packages/kevincobain2000-laravel-alert-notifications)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[marvinlabs/laravel-discord-logger

Logging to a discord channel in Laravel

2081.1M2](/packages/marvinlabs-laravel-discord-logger)[larabug/larabug

Laravel 6.x/7.x/8.x/9.x/10.x/11.x/12.x/13.x bug notifier

299549.3k1](/packages/larabug-larabug)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、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).

14642.7k1](/packages/guanguans-laravel-exception-notify)[binarybuilds/laravel-mail-manager

A Laravel mail manager to record and re-send all outgoing emails.

2440.2k1](/packages/binarybuilds-laravel-mail-manager)[kssadi/log-tracker

A powerful, intuitive, and efficient log viewer for Laravel applications.

264.8k](/packages/kssadi-log-tracker)

PHPackages © 2026

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