Download the PHP package jdavidbakr/laravel-sns-error-notification without Composer
On this page you can find all versions of the php package jdavidbakr/laravel-sns-error-notification. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jdavidbakr/laravel-sns-error-notification
More information about jdavidbakr/laravel-sns-error-notification
Files in jdavidbakr/laravel-sns-error-notification
Package laravel-sns-error-notification
Short Description Sends a notification via SNS when there is an exception
License MIT
Homepage https://github.com/jdavidbakr/laravel-sns-error-notification
Informations about the package laravel-sns-error-notification
LaravelSNSErrorNotification
This package is a simple extension of the Laravel Exception Handler that sends a notification via AWS SNS whenever there is an error, with helpful information like the URL that was called and the stack trace. The notification is cached so that it only sends one notice per unique error message every 24 hours, and only fires if the application is not in debug mode (so you aren't innundated with error messages while working on your project).
You can also enable writing to a database table, with automatic purging after a certain timeframe.
Install
Via Composer
Add the service provider to your config/app.php file:
If you haven't already set up to use AWS, you will need to install the service provider:
as well as the Facade in the 'aliases' array:
Install the config file
This inserts a config file at config/sns-error-notification.php. You must set the SNS topic and subject in there. Also note that you will need to configure the config/aws.php file as needed to give access to the SNS topic.
Install the migrations
This installs the tables needed to store the exceptions in the database.
Usage
To use, you will need to change the app/Exceptions/Handler.php class to extend \jdavidbakr\LaravelSNSErrorNotification\ErrorNotifier instead of \Illuminate\Foundation\Exceptions\Handler. The easiest way is to remove this line:
and replace it with this:
Testing
Contributing
Please see CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- J David Baker
- All Contributors
License
The MIT License (MIT). Please see License File for more information.