jdavidbakr/laravel-sns-error-notification

Sends a notification via SNS when there is an exception
20,445
Install
composer require jdavidbakr/laravel-sns-error-notification
Latest Version:1.1.1
PHP:~5.5|~7.0
License:MIT
Last Updated:Mar 21, 2017
Links: GitHub  ·  Packagist
Maintainer: jdavidbakr

LaravelSNSErrorNotification

Latest Version on Packagist Software License Total Downloads

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

$ composer require jdavidbakr/laravel-sns-error-notification

Add the service provider to your config/app.php file:

jdavidbakr\LaravelSNSErrorNotification\LaravelSNSErrorNotificationServiceProvider::class,

If you haven't already set up to use AWS, you will need to install the service provider:

Aws\Laravel\AwsServiceProvider::class

as well as the Facade in the 'aliases' array:

'AWS' => Aws\Laravel\AwsFacade::class,

Install the config file

php artisan vendor:publish 

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

php artisan migrate

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:

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

and replace it with this:

use jdavidbakr\LaravelSNSErrorNotification\ErrorNotifier as ExceptionHandler;

Testing

$ phpunit

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

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

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

jdavidbakr/laravel-cache-garbage-collector

A script that will clean up expired cache files if the system is using the files...

169,094 59
jdavidbakr/mail-tracker

Logs and tracks all outgoing emails from Laravel

1,376,285 623
jdavidbakr/replaceable-model

Adds 'REPLACE' and 'INSERT IGNORE' query capability to eloquent models

248,034 72
erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1