2017 © Pedro Peláez
 

library sneaker

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

image

nicoalvarez-cd/sneaker

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  • Friday, September 1, 2017
  • by nicoalvarez-cd
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 0 Open issues
  • 16 Versions
  • 0 % Grown

The README.md

Laravel Exception Notifications

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel applications., (*1)

sneaker example image, (*2)

Install

Install via Composer

For Laravel <= 5.2, please use the v1 branch!

$ composer require squareboat/sneaker

Configure Laravel

Once installation operation is complete, simply add the service provider to your project's config/app.php file:, (*3)

Service Provider

SquareBoat\Sneaker\SneakerServiceProvider::class,

Add Sneaker's Exception Capturing

Add exception capturing to app/Exceptions/Handler.php:, (*4)

public function report(Exception $exception)
{
    app('sneaker')->captureException($exception);

    parent::report($exception);
}

Configuration File

Create the Sneaker configuration file with this command:, (*5)

$ php artisan vendor:publish --provider="SquareBoat\Sneaker\SneakerServiceProvider"

The config file will be published in config/sneaker.php, (*6)

Following are the configuration attributes used for the Sneaker., (*7)

silent

The package comes with 'silent' => true, configuration by default, since you probably don't want error emailing enabled on your development environment. Especially if you've set 'debug' => true,., (*8)

'silent' => env('SNEAKER_SILENT', true),

For sending emails when an exception occurs set SNEAKER_SILENT=false in your .env file., (*9)

capture

It contains the list of the exception types that should be captured. You can add your exceptions here for which you want to send error emails., (*10)

By default, the package has included Symfony\Component\Debug\Exception\FatalErrorException::class., (*11)

'capture' => [
    Symfony\Component\Debug\Exception\FatalErrorException::class,
],

You can also use '*' in the $capture array which will in turn captures every exception., (*12)

'capture' => [
    '*'
],

To use this feature you should add the following code in app/Exceptions/Handler.php:, (*13)

public function report(Exception $exception)
{
    if ($this->shouldReport($exception)) {
        app('sneaker')->captureException($exception);
    }

    parent::report($exception);
}

to

This is the list of recipients of error emails., (*14)

'to' => [
    // 'hello@example.com',
],

ignored_bots

This is the list of bots for which we should NOT send error emails., (*15)

'ignored_bots' => [
    'googlebot',        // Googlebot
    'bingbot',          // Microsoft Bingbot
    'slurp',            // Yahoo! Slurp
    'ia_archiver',      // Alexa
],

Customize

If you need to customize the subject and body of email, run following command:, (*16)

$ php artisan vendor:publish --provider="SquareBoat\Sneaker\SneakerServiceProvider"

Note - Don't run this command again if you have run it already., (*17)

Now the email's subject and body view are located in the resources/views/vendor/sneaker directory., (*18)

We have passed the thrown exception object $exception in the view which you can use to customize the view to fit your needs., (*19)

Sneak

Test your integration

To verify that Sneaker is configured correctly and our integration is working, use sneaker:sneak Artisan command:, (*20)

$ php artisan sneaker:sneak

A SquareBoat\Sneaker\Exceptions\DummyException class will be thrown and captured by Sneaker. The captured exception will appear in your configured email immediately., (*21)

Security

If you discover any security related issues, please email amit.gupta@squareboat.com instead of using the issue tracker., (*22)

Credits

About SquareBoat

SquareBoat is a startup focused, product development company based in Gurgaon, India. You'll find an overview of all our open source projects on GitHub., (*23)

License

The MIT License. Please see License File for more information. Copyright © 2016 SquareBoat, (*24)

The Versions

01/09 2017

dev-master

9999999-dev

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

01/09 2017

v2.0.5

2.0.5.0

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

01/09 2017

v2.0.4

2.0.4.0

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

01/05 2017

dev-dev

dev-dev

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

19/04 2017

v2.0.3

2.0.3.0

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

01/04 2017

v2.0.2

2.0.2.0

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

01/04 2017

v1.x-dev

1.9999999.9999999.9999999-dev

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

01/04 2017

v1.0.3

1.0.3.0

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

01/04 2017

v2.0.1

2.0.1.0

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

30/03 2017

v2.0.0

2.0.0.0

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

01/11 2016

v0.1.2

0.1.2.0

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

01/11 2016

v1.0.2

1.0.2.0

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

29/09 2016

v0.1.1

0.1.1.0

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

28/09 2016

v0.1.0

0.1.0.0

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

26/09 2016

v1.0.1

1.0.1.0

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions

25/09 2016

v1.0.0

1.0.0.0

An easy way to send emails whenever an exception occurs on the server for Laravel Applications.

  Sources   Download

MIT

The Requires

 

by Amit Gupta

laravel email exceptions