Download the PHP package bwt-team/laravel-error-mailer without Composer
On this page you can find all versions of the php package bwt-team/laravel-error-mailer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-error-mailer
English description | Russian description
Laravel 5 Error Mailer
This package allows to enable and set up email alerts in case errors appear.
Contents
- Setup
- Setup in Laravel
- Setup in Lumen
- License
Setup
Setup this package with composer using the following command:
Setup in Laravel
After composer update add service provider into providers
in config/app.php
.
This service provider will enable with an option to publish config file to update package settings depending on your needs. After publication this service provider can be disabled, it is not needed for package work. For publication please use:
Also, to make package work please register the setup class in bootstrap/app.php
. Registration should happen before Application sample is returned.
Setup in Lumen
To send email messages you can use laravel component or create a class for sending yourself by initializing class, which implements \Swift_Transport interface. To set up laravel component:
-
setup component using the following command:
- copy config file into
config
directory, which is stored in root catalogue (or create the directory yourself). - Copy config file
vendor/bwt-team/laravel-error-mailer/config/error-mailer.php
into config directory, which is stored in root directory (or create it yourself if it is missing) and set it up according to your needs. -
enable service provider in
bootstrap/app
. - setup settings from configuration file.
To enable sending email alerts you need to create a class instance \BwtTeam\LaravelErrorMailer\Configurators\MailConfigurator
in bootstrap/app
, its constructor looks like following:
This class is responsible for sending alert emails by mail but enabling it will disable writing logs into file, which is enabled in lumen by default. In order not to disable
writing you need to create a class instance \BwtTeam\LaravelErrorMailer\Configurators\FileConfigurator
. Class constructor looks like the following:
After that you need to pass this instance into with
method in \BwtTeam\LaravelErrorMailer\Configurators\MailConfigurator
class.
Each configuration class has options to work with monologue processors. For this you need to pass process instance to class name into constructor or add with the help of addProcessors
method.
In addition to standard monologue processors, the following out-of-box processors are available:
When component is set up you need to pass it to configureMonologUsing
method in Application class before it is returned.
Final setup will look like this:
License
This package is using MIT.
All versions of laravel-error-mailer with dependencies
monolog/monolog Version ~1.11
illuminate/support Version ^5.4
illuminate/contracts Version ^5.4