|
1 |
| -## Laravel Alert Notifications |
| 1 | + |
| 2 | +<h1 align="center"> |
| 3 | + Laravel Alert Notifcations |
| 4 | +</h1> |
| 5 | +<p align="center"> |
| 6 | + Send php exceptions to email, microsoft teams, slack. |
| 7 | + <br/> |
| 8 | + Notifications are throttle enabled so devs don't get a lot of emails from one host |
| 9 | + <br/> |
| 10 | + (or all hosts if cache driver is shared). |
| 11 | +</p> |
| 12 | + |
| 13 | + |
2 | 14 | <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
3 | 15 | [](#contributors-)
|
4 | 16 | <!-- ALL-CONTRIBUTORS-BADGE:END -->
|
5 | 17 |
|
6 |
| -<a href="https://travis-ci.org/kevincobain2000/laravel-alert-notifications"><img src="https://travis-ci.org/kevincobain2000/laravel-alert-notifications.svg?branch=master" alt="Travis Build Status"></a> |
7 |
| -<a href="https://scrutinizer-ci.com/g/kevincobain2000/laravel-alert-notifications"><img src="https://scrutinizer-ci.com/g/kevincobain2000/laravel-alert-notifications/badges/quality-score.png?b=master" alt="Quality Score"></a> |
8 |
| -<a href="https://scrutinizer-ci.com/g/kevincobain2000/laravel-alert-notifications"><img src="https://scrutinizer-ci.com/g/kevincobain2000/laravel-alert-notifications/badges/build.png?b=master" alt="Build Status"></a> |
9 |
| -<a href="https://scrutinizer-ci.com/g/kevincobain2000/laravel-alert-notifications"><img src="https://scrutinizer-ci.com/g/kevincobain2000/laravel-alert-notifications/badges/coverage.png?b=master" alt="Coverage Status"></a> |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
10 | 25 |
|
11 |
| -Send php exceptions to email, microsoft teams, slack. |
12 |
| -Notifications are throttle enabled so devs don't get a lot of emails from one host (or all hosts if cache driver is shared) |
13 |
| -Please check config for more details on throttling. |
14 | 26 |
|
15 | 27 | | Channels | Progress |
|
16 | 28 | | :------- | :--------- |
|
@@ -82,15 +94,15 @@ ALERT_NOTIFICATION_CURL_PROXY=
|
82 | 94 | ### Usage
|
83 | 95 |
|
84 | 96 | ```php
|
85 |
| -new AlertDispatcher( |
86 |
| - Exception $e |
| 97 | +new AlertDispatcher( |
| 98 | + Exception $e |
87 | 99 | [, array $dontAlertExceptions = []] // Exceptions that shouldn't trigger notifications
|
88 | 100 | [, array $notificationLevelsMapping = []] // [Exception class => Notification level] mapping
|
89 | 101 | [, array $exceptionContext = []] // Array of context data
|
90 | 102 | )
|
91 | 103 | ```
|
92 | 104 |
|
93 |
| -In **app/Exceptions/Handler.php**. It is better to use a try catch to prevent loop. |
| 105 | +In **app/Exceptions/Handler.php**. It is better to use a try catch to prevent loop. |
94 | 106 |
|
95 | 107 | ```php
|
96 | 108 | use Kevincobain2000\LaravelAlertNotifications\Dispatcher\AlertDispatcher;
|
@@ -145,7 +157,7 @@ class Handler extends ExceptionHandler
|
145 | 157 | | | ``%ExceptionLevel%`` => ``current notification level`` |
|
146 | 158 | | | ex. ``'subject' => 'Exception [%ExceptionType%] has ocurred``' | |
|
147 | 159 | | mail.#level# | Configs for each notification level |
|
148 |
| -| | notification levels refer to those defined in ``\Psr\Log\LogLevel`` | |
| 160 | +| | notification levels refer to those defined in ``\Psr\Log\LogLevel`` | |
149 | 161 | | mail.#level#.toAddress | (default mail.to_address), #level# notification recipient e-mail |
|
150 | 162 | | mail.#level#.subject | #level# notification e-mail subject |
|
151 | 163 | | microsoft_teams.enabled | (default true), false will not notify to teams |
|
|
0 commit comments