Looking to hire Laravel developers? Try LaraJobs

laravel-mailable-exception maintained by lobotomised

Description
Send any exception to an email
Author
lobotomised
Last update
2026/04/21 00:30 (dev-dependabot/github_actions/dependabot/fetch-metadata-3.1.0)
License
Downloads
733

Comments
comments powered by Disqus

Send any exception to an email

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Installation

You can install the package via composer:

composer require lobotomised/laravel-mailable-exception

Modifier App\Exceptions\Handler;

    public function register(): void
    {
        $this->reportable(function (Throwable $e) {
            (new LaravelMailableException)->toMail($e);
        });
    }

You can publish the config file with:

php artisan vendor:publish --tag="laravel-mailable-exception-config"

This is the contents of the published config file:

return [
    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
        'name' => env('MAIL_FROM_NAME', 'Example'),
    ],
    'to' => [
        'address' => 'your@example.com',
    ],
    'subject' => 'An exception has occurred',
    'allowed_environments' => ['production'],
];

Optionally, you can publish the views using

php artisan vendor:publish --tag="laravel-mailable-exception-views"

License

The MIT License (MIT). Please see License File for more information.