Download the PHP package alverated/laravel-error-mailer without Composer
On this page you can find all versions of the php package alverated/laravel-error-mailer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alverated/laravel-error-mailer
More information about alverated/laravel-error-mailer
Files in alverated/laravel-error-mailer
Package laravel-error-mailer
Short Description Error Mailer for Laravel
License MIT
Informations about the package laravel-error-mailer
Laravel-Error-Mailer
Error Mailer for Laravel 5.2
Installation
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"
}
}