Fork Notice: This is a Laravel 11 compatible fork of squareboat/sneaker. The original package is no longer actively maintained for newer Laravel versions.
An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel applications.
For Laravel 11.x, please use the main branch!
$ composer require filimoni/sneaker
Add exception capturing to bootstrap/app.php:
return Application::configure(basePath: dirname(__DIR__))
// ...
->withExceptions(function (Exceptions $exceptions) {
$exceptions->report(function (\Throwable $e) {
app('sneaker')->captureException($e);
});
})->create();Create the Sneaker configuration file with this command:
$ php artisan vendor:publish --provider="Filimoni\Sneaker\SneakerServiceProvider"The config file will be published in config/sneaker.php
Following are the configuration attributes used for the Sneaker.
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.
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\ErrorHandler\Error\FatalError::class.
'capture' => [
Symfony\Component\ErrorHandler\Error\FatalError::class,
],You can also use '*' in the $capture array which will in turn captures every exception.
'capture' => [
'*'
],To use this feature, simply use the same integration code shown above. Sneaker will capture every exception type when '*' is set.
This is the list of recipients of error emails. Set it in SNEAKER_TO= in your .env file.
Multiple addresses can be added as a comma-separated list.
'to' => explode(',', env('SNEAKER_TO', '')),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
],If you need to customize the subject and body of email, run following command:
$ php artisan vendor:publish --provider="Filimoni\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.
To verify that Sneaker is configured correctly and our integration is working, use sneaker:sneak Artisan command:
$ php artisan sneaker:sneakA Filimoni\Sneaker\Exceptions\DummyException class will be thrown and captured by Sneaker. The captured exception will appear in your configured email immediately.
If you discover any security related issues, please email akaamitgupta@gmail.com instead of using the issue tracker.
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.
The MIT License. Please see License File for more information. Copyright © 2026 SquareBoat
