Package Data | |
---|---|
Maintainer Username: | alverated |
Maintainer Contact: | alverated013@gmail.com (Alver G. Noquiao) |
Package Create Date: | 2016-06-29 |
Package Last Update: | 2020-07-29 |
Language: | HTML |
License: | MIT |
Last Refreshed: | 2024-11-23 03:14:44 |
Package Statistics | |
---|---|
Total Downloads: | 152 |
Monthly Downloads: | 3 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 1 |
Total Forks: | 2 |
Total Open Issues: | 0 |
Error Mailer for Laravel 5.2
Laravel Error Mailer can be installed via Composer by requiring the alverated/laravel-error-mailer
package in your project's composer.json
.
{
"require": {
"alverated/laravel-error-mailer": "dev-master"
}
}
Register the service provider with the application. Open up config/app.php
and find the providers
key.
'providers' => [
// ...
Alverated\LaravelErrorMailer\ErrorMailerServiceProvider::class,
],
Publish the configurations Run this on the command line from the root of your project.
$ php artisan vendor:publish
A configuration and blade file will be publish to config/laravel-error-mailer.php
and views/vendor/mailer.blade.php
.
Update your settings in the generated configuration file.
##Usage
Open app/Exceptions/Handler.php
and import Alverated\LaravelErrorMailer\ErrorMailer
//...
use Alverated\LaravelErrorMailer\ErrorMailer;
and add these two lines of codes to public function report(Exception $e)
below parent::report($e);
public function report(Exception $e)
{
parent::report($e);
// add this code
if ($this->shouldReport($e)) {
$err = new ErrorMailer($e);
$err->sendError();
}
}
###Note Add this to your composer.json if you're using any of these drivers
{
"require": {
"guzzlehttp/guzzle": "~5.3|~6.0",
"aws/aws-sdk-php": "~3.0"
}
}