All Projects → squareboat → Sneaker

squareboat / Sneaker

Licence: mit
An easy way to send emails whenever an exception occurs on server.

Projects that are alternatives of or similar to Sneaker

Laravel Pdf
A Simple package for easily generating PDF documents from HTML. This package is specially for laravel but you can use this without laravel.
Stars: ✭ 79 (-64.57%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Voyager Hooks
Hooks system integrated into Voyager.
Stars: ✭ 200 (-10.31%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Console Logger
Logging and Notifications for Laravel Console Commands.
Stars: ✭ 79 (-64.57%)
Mutual labels:  error-handling, laravel, laravel-package
Laravel Api Health
Monitor first and third-party services and get notified when something goes wrong!
Stars: ✭ 65 (-70.85%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Auto Translate
Automatically translate your language files using a translator service
Stars: ✭ 153 (-31.39%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Remember Uploads
Laravel Middleware and helper for remembering file uploads during validation redirects
Stars: ✭ 67 (-69.96%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Blogetc
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.
Stars: ✭ 198 (-11.21%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Orm
A drop-in Doctrine ORM 2 implementation for Laravel 5+ and Lumen
Stars: ✭ 712 (+219.28%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Hooks
Hooks is a extension system for your Laravel application.
Stars: ✭ 202 (-9.42%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Pagination
🎁 Laravel 5 Custom Pagination Presenter
Stars: ✭ 119 (-46.64%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Email Verification
Laravel package to handle user verification using an activation mail
Stars: ✭ 63 (-71.75%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Page Speed
Package to optimize your site automatically which results in a 35%+ optimization
Stars: ✭ 2,097 (+840.36%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Settings
Simple Settings package for a laravel application
Stars: ✭ 45 (-79.82%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laraupdater
Enable Laravel App Self-Update. Allow your Laravel Application to auto-update itself.
Stars: ✭ 75 (-66.37%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Bugsnag Laravel
Bugsnag notifier for the Laravel PHP framework. Monitor and report Laravel errors.
Stars: ✭ 746 (+234.53%)
Mutual labels:  error-handling, laravel, error-monitoring
Laravel Excel
🚀 Supercharged Excel exports and imports in Laravel
Stars: ✭ 10,417 (+4571.3%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Telegram
✈️ Telegram Notifications Channel for Laravel
Stars: ✭ 450 (+101.79%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Js Localization
🌐 Convert your Laravel messages and consume them in the front-end!
Stars: ✭ 451 (+102.24%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Eye
Eyewitness.io package for Laravel 5 applications
Stars: ✭ 114 (-48.88%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Telegram Bot Sdk
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
Stars: ✭ 2,212 (+891.93%)
Mutual labels:  laravel, laravel-package, laravel-5-package

Laravel Exception Notifications

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

sneaker example image

Install

Install via Composer

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

For Laravel 5.2 < version <= 6.x, please use the v5 branch!

$ composer require squareboat/sneaker

Configure Laravel

If you are using laravel 5.5 or higher you should skip this step.

If you are using laravel 5.3 or 5.4, simply add the service provider to your project's config/app.php file:

Service Provider

SquareBoat\Sneaker\SneakerServiceProvider::class,

Add Sneaker's Exception Capturing

Add exception capturing to app/Exceptions/Handler.php:

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

    parent::report($exception);
}

Configuration File

Create the Sneaker configuration file with this command:

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

The config file will be published in config/sneaker.php

Following are the configuration attributes used for the Sneaker.

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,.

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

For sending emails when an exception occurs set SNEAKER_SILENT=false in your .env file.

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.

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

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

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

'capture' => [
    '*'
],

To use this feature you should add the following code in app/Exceptions/Handler.php:

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.

'to' => [
    // '[email protected]',
],

ignored_bots

This is the list of bots for which we should NOT send error emails.

'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:

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

Note - Don't run this command again if you have run it already.

Now the email's subject and body view are located in the resources/views/vendor/sneaker directory.

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

Sneak

Test your integration

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

$ 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.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

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.

License

The MIT License. Please see License File for more information. Copyright © 2020 SquareBoat

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].