PHPackages                             darshan/exceptionemail - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. darshan/exceptionemail

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

darshan/exceptionemail
======================

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

v1.0.6(1y ago)52871MITPHPPHP &gt;=7.4 || ^8.0

Since Sep 2Pushed 1y ago3 watchersCompare

[ Source](https://github.com/damku999/excptionemail)[ Packagist](https://packagist.org/packages/darshan/exceptionemail)[ RSS](/packages/darshan-exceptionemail/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (8)Versions (5)Used By (0)

Laravel Exception Notifications
===============================

[](#laravel-exception-notifications)

An easy-to-use package for sending email notifications with stack traces whenever an exception occurs in your Laravel application.

[![exceptionemail example image](exceptionemail.png?raw=true "ExceptionEmail")](exceptionemail.png?raw=true)

Installation Guide
------------------

[](#installation-guide)

### 1. Install via Composer

[](#1-install-via-composer)

To install the package, run the following Composer command:

```
composer require darshan/exceptionemail
```

### 2. Configure Laravel

[](#2-configure-laravel)

#### Breaking Changes for Laravel 11: Exception Handling in a Custom Service Provider

[](#breaking-changes-for-laravel-11-exception-handling-in-a-custom-service-provider)

In Laravel 11, exception handling logic should be placed in a custom service provider. Follow these steps to set it up:

1. **Create a Custom Service Provider:**

Create a new service provider that will handle exceptions in your application. Add the following code in `app/Providers/ExceptionServiceProvider.php`:

```
namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Throwable;

class ExceptionServiceProvider extends ServiceProvider
{
    public function register()
    {
        // Nothing here for now.
    }

    public function boot()
    {
        app()->error(function (Throwable $e) {
            app('exceptionemail')->captureException($e);
        });
    }
}
```

2. **Register the Service Provider:**

In `bootstrap/providers.php`, register your custom `ExceptionServiceProvider` by adding it to the `providers` array:

```
return [
    // Other service providers...
    App\Providers\ExceptionServiceProvider::class,
],
```

#### Add ExceptionEmail's Exception Capturing (for version of Laravel below 11 like 8,9,10)

[](#add-exceptionemails-exception-capturing-for-version-of-laravel-below-11-like-8910)

In order to capture exceptions and send emails (for Laravel versions prior to 11 or if you prefer using `Handler.php`), modify the `report` method in your `app/Exceptions/Handler.php` file:

```
use Throwable;

public function report(Throwable $exception)
{
    app('exceptionemail')->captureException($exception);

    parent::report($exception);
}
```

### 3. Publish the Configuration File

[](#3-publish-the-configuration-file)

Publish the ExceptionEmail configuration file by running the following Artisan command:

```
php artisan vendor:publish --provider="Webmonks\ExceptionEmail\ExceptionEmailServiceProvider"
```

This will create a configuration file at `config/exceptionemail.php`.

Configuration
-------------

[](#configuration)

### Silent Mode

[](#silent-mode)

By default, the package is configured with `'silent' => true` to prevent sending exception emails in development environments, especially when `'debug' => true` is enabled in Laravel.

You can control this behavior with the following configuration option:

```
'silent' => env('IS_EXCEPTION_EMAIL_SILENT', true),
```

To enable email notifications when exceptions occur, set `IS_EXCEPTION_EMAIL_SILENT=false` in your `.env` file.

### Capture Exceptions

[](#capture-exceptions)

You can specify which types of exceptions should trigger email notifications. By default, the package includes `Symfony\Component\Debug\Exception\FatalErrorException::class`.

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

To capture all exceptions, you can use the wildcard `'*'`:

```
'capture' => [
    '*'
],
```

### Ignored Exceptions

[](#ignored-exceptions)

You may define exceptions that should not trigger email notifications. This is done by adding them to the `ignored_exception` array.

```
'ignored_exception' => [
    // Webmonks\ExceptionEmail\Exceptions\DummyException::class,
],
```

For example, to ignore `FatalErrorException`, use the following:

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

#### Usage in `Handler.php`

[](#usage-in-handlerphp)

Update the `report` method in `app/Exceptions/Handler.php` to incorporate ignored exceptions:

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

    parent::report($exception);
}
```

### Recipients

[](#recipients)

Specify the email addresses that should receive the exception notifications by updating the `to` array:

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

### Ignored Bots

[](#ignored-bots)

You can configure the package to ignore errors triggered by bots, like search engine crawlers. The default configuration includes common bots such as:

```
'ignored_bots' => [
    'googlebot',
    'bingbot',
    'slurp',
    'ia_archiver',
],
```

Customizing Emails
------------------

[](#customizing-emails)

To customize the subject and body of the error notification emails, publish the email templates by running:

```
php artisan vendor:publish --provider="Webmonks\ExceptionEmail\ExceptionEmailServiceProvider"
```

> **Note:** Only run this command once to avoid overwriting custom changes.

The email views will be published to `resources/views/vendor/exceptionemail`. You can modify the templates as needed, and you have access to the `$exception` object in the views.

Testing the Integration
-----------------------

[](#testing-the-integration)

To verify that ExceptionEmail is correctly set up and working, use the following Artisan command:

```
php artisan exceptionemail:test
```

This command will throw a `Webmonks\ExceptionEmail\Exceptions\DummyException`, and the package will capture and send it as an email. If everything is set up correctly, you should receive the test email.

Security
--------

[](#security)

If you discover any security issues, please contact us directly via email at , rather than opening an issue on GitHub.

Credits
-------

[](#credits)

- [Darshan Baraiya](https://github.com/damku999)
- [Squareboat](https://github.com/squareboat/sneaker)
- [All Contributors](../../contributors)

About Webmonks
--------------

[](#about-webmonks)

[Webmonks](https://webmonks.in) is a product development startup based in Ahmedabad, India. You can explore all our open-source projects on [GitHub](https://github.com/damku999).

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT License](LICENSE.md).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

4

Last Release

614d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.3

1.0.4PHP &gt;=7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/db4eb155c593a3464664968d1af6c21853391ea61147d1576f11389496f2e431?d=identicon)[damku999](/maintainers/damku999)

---

Top Contributors

[![damku999](https://avatars.githubusercontent.com/u/8331339?v=4)](https://github.com/damku999 "damku999 (27 commits)")

---

Tags

capturedebuggingemailemail-notificationserror-handlingerror-monitoringexceptionexception-emailexception-emailsexception-handlinglaravellaravel-exceptionslaravel-packagelaravel8mailnotificationphpphp8error-reportingerror-monitoringexception trackingbug-trackingexception notifierlaravel-log-emailautomatic-error-notificationlaravel-error-alertsserver-error-emailexception-logginglaravel-exception-monitoringemail-alertsreal-time-error-notificationlaravel-exception-handlererror-debuggingLaravel Error MonitoringServer Error NotificationStack Trace Email AlertsLaravel Bug TrackingReal-time Error AlertsLaravel Error LoggingAutomated Error Notification

### Embed Badge

![Health badge](/badges/darshan-exceptionemail/health.svg)

```
[![Health](https://phpackages.com/badges/darshan-exceptionemail/health.svg)](https://phpackages.com/packages/darshan-exceptionemail)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)[propaganistas/laravel-disposable-email

Disposable email validator

5762.6M6](/packages/propaganistas-laravel-disposable-email)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
