PHPackages                             jeremykenedy/laravel-exception-notifier - 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. jeremykenedy/laravel-exception-notifier

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

jeremykenedy/laravel-exception-notifier
=======================================

Laravel exception notifier will send an email of of the error along with the stack trace to the chosen recipients.

V4.1.0(7mo ago)137264.9k—8%30[1 issues](https://github.com/jeremykenedy/laravel-exception-notifier/issues)MITPHPPHP ^8.0CI failing

Since May 19Pushed 7mo ago5 watchersCompare

[ Source](https://github.com/jeremykenedy/laravel-exception-notifier)[ Packagist](https://packagist.org/packages/jeremykenedy/laravel-exception-notifier)[ GitHub Sponsors](https://github.com/jeremykenedy)[ Patreon](https://www.patreon.com/jeremykenedy)[ RSS](/packages/jeremykenedy-laravel-exception-notifier/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (17)Used By (0)

Laravel Exception Notifier | A Laravel 5, 6, 7, 8, 9 and 10 Exceptions Email Notification [Package](https://packagist.org/packages/jeremykenedy/laravel-exception-notifier)
===========================================================================================================================================================================

[](#laravel-exception-notifier--a-laravel-5-6-7-8-9-and-10-exceptions-email-notification-package)

[![Total Downloads](https://camo.githubusercontent.com/92ceb1ac855260d3179a0e684e7fb0b31f60fda64914d748b934b76637a8a7c4/68747470733a2f2f706f7365722e707567782e6f72672f6a6572656d796b656e6564792f6c61726176656c2d657863657074696f6e2d6e6f7469666965722f642f746f74616c2e737667)](https://packagist.org/packages/jeremykenedy/laravel-exception-notifier)[![Latest Stable Version](https://camo.githubusercontent.com/27666e424eb8d7efde9be308de62435ce35ee4080ff608b45e5718d591fdf16a/68747470733a2f2f706f7365722e707567782e6f72672f6a6572656d796b656e6564792f6c61726176656c2d657863657074696f6e2d6e6f7469666965722f762f737461626c652e737667)](https://packagist.org/packages/jeremykenedy/laravel-exception-notifier)[![Build Status](https://camo.githubusercontent.com/eddf7db67ec6f6b28ba6f35dbbb1ad9a7f064c9eb6d604b7bf0bf4465d1f6e79/68747470733a2f2f7472617669732d63692e6f72672f6a6572656d796b656e6564792f6c61726176656c2d657863657074696f6e2d6e6f7469666965722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jeremykenedy/laravel-exception-notifier)[![StyleCI](https://camo.githubusercontent.com/e2872338b90f9c49d652100ce6844b68f63529c53bb576fc969fd3d8aa329562/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f39313833333138312f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/91833181)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/29c0d0e32b3e26f0040041d660487f9d08d5c617dc3cb85791f0821a054b64f9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a6572656d796b656e6564792f6c61726176656c2d657863657074696f6e2d6e6f7469666965722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jeremykenedy/laravel-exception-notifier/?branch=master)[![Code Intelligence Status](https://camo.githubusercontent.com/f1bb1db2f6b48245a4468272316c2ec991f53ea828fde8bffb2784cba4e4c07e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a6572656d796b656e6564792f6c61726176656c2d657863657074696f6e2d6e6f7469666965722f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)[![MadeWithLaravel.com shield](https://camo.githubusercontent.com/f99363e0e5a3e23b3178de0ad4d80e7b57e886b3230a8824fc05aa0b98b6d831/68747470733a2f2f6d616465776974686c61726176656c2e636f6d2f73746f726167652f7265706f2d736869656c64732f313335302d736869656c642e737667)](https://madewithlaravel.com/p/laravel-exception-notifier/shield-link)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

Table of contents:

- [About](#about)
- [Requirements](#requirements)
- [Installation Instructions](#installation-instructions)
- [Screenshots](#screenshots)
- [File Tree](#file-tree)
- [License](#license)

About
-----

[](#about)

Laravel exception notifier will send an email of the error along with the stack trace to the chosen recipients. [This Package](https://packagist.org/packages/jeremykenedy/laravel-exception-notifier) includes all necessary traits, views, configs, and Mailers for email notifications upon your applications exceptions. You can customize who send to, cc to, bcc to, enable/disable, and custom subject or default subject based on environment. Built for Laravel 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6, 7, 8, 9, and 10.

Get the errors and fix them before the client even reports them, that's why this exists!

Requirements
------------

[](#requirements)

- [Laravel 5.2+, 6, 7, 8, 9, or 10](https://laravel.com/docs/installation)

Installation Instructions
-------------------------

[](#installation-instructions)

1. From your projects root folder in terminal run:

    Laravel 9-10 use:

    ```
        composer require jeremykenedy/laravel-exception-notifier
    ```

    Laravel 7-8 use:

    ```
        composer require jeremykenedy/laravel-exception-notifier:2.2.0
    ```

    Laravel 6 and below use:

    ```
        composer require jeremykenedy/laravel-exception-notifier:1.2.0
    ```
2. Register the package

- Laravel 5.5 and up Uses package auto discovery feature, no need to edit the `config/app.php` file.
- Laravel 5.4 and below Register the package with laravel in `config/app.php` under `providers` with the following:

```
    jeremykenedy\laravelexceptionnotifier\LaravelExceptionNotifier::class,
```

3. Publish the packages view, mailer, and config files by running the following from your projects root folder:

```
    php artisan vendor:publish --tag=laravelexceptionnotifier
```

#### NOTE: If upgrading to Laravel 9 or 10 from an older version of this package you will need to republish the assets with:

[](#note-if-upgrading-to-laravel-9-or-10-from-an-older-version-of-this-package-you-will-need-to-republish-the-assets-with)

```
    php artisan vendor:publish --force --tag=laravelexceptionnotifier
```

4. In `App\Exceptions\Handler.php` include the additional following classes in the head:

#### Laravel 9 and Above use:

[](#laravel-9-and-above-use)

```
    use App\Mail\ExceptionOccurred;
    use Illuminate\Support\Facades\Log;
    use Illuminate\Support\Facades\Mail;
    use Throwable;
```

#### Laravel 8 and Below use:

[](#laravel-8-and-below-use)

```
    use App\Mail\ExceptionOccured;
    use Illuminate\Support\Facades\Log;
    use Mail;
    use Symfony\Component\Debug\Exception\FlattenException;
    use Symfony\Component\Debug\ExceptionHandler as SymfonyExceptionHandler;
```

5. Update `App\Exceptions\Handler.php`

#### Laravel 9 and Above:

[](#laravel-9-and-above)

##### Add the `sendEmail()` method:

[](#add-the-sendemail-method)

```
    /**
     * Sends an email upon exception.
     */
    public function sendEmail(Throwable $exception): void
    {
        try {
            $content = [
                'message' => $exception->getMessage(),
                'file' => $exception->getFile(),
                'line' => $exception->getLine(),
                'trace' => $exception->getTrace(),
                'url' => request()->url(),
                'body' => request()->all(),
                'ip' => request()->ip(),
            ];

            Mail::send(new ExceptionOccurred($content));
        } catch (Throwable $exception) {
            Log::error($exception);
        }
    }
```

##### Add or update the `register()` method:

[](#add-or-update-the-register-method)

```
    /**
     * Register the exception handling callbacks for the application.
     */
    public function register(): void
    {
        $this->reportable(function (Throwable $e) {
            $enableEmailExceptions = config('exceptions.emailExceptionEnabled');

            if ($enableEmailExceptions) {
                $this->sendEmail($e);
            }
        });
    }
```

#### Laravel 8 and Below:

[](#laravel-8-and-below)

##### Replace the `report()` method with:

[](#replace-the-report-method-with)

```
    /**
     * Report or log an exception.
     *
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
     *
     * @param \Throwable $exception
     *
     * @return void
     */
    public function report(Throwable $exception)
    {
        $enableEmailExceptions = config('exceptions.emailExceptionEnabled');

        if ($enableEmailExceptions === '') {
            $enableEmailExceptions = config('exceptions.emailExceptionEnabledDefault');
        }

        if ($enableEmailExceptions && $this->shouldReport($exception)) {
            $this->sendEmail($exception);
        }

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

##### Add the method `sendEmail()`:

[](#add-the-method-sendemail)

```
    /**
     * Sends an email upon exception.
     *
     * @param \Throwable $exception
     *
     * @return void
     */
    public function sendEmail(Throwable $exception)
    {
        try {
            $e = FlattenException::create($exception);
            $handler = new SymfonyExceptionHandler();
            $html = $handler->getHtml($e);

            Mail::send(new ExceptionOccured($html));
        } catch (Throwable $exception) {
            Log::error($exception);
        }
    }
```

6. Configure your email settings in the `.env` file.
7. Add the following (optional) settings to your `.env` file and enter your settings:

    - **Note:** the defaults for these are located in `config/exception.php`

```
        EMAIL_EXCEPTION_ENABLED=false
        EMAIL_EXCEPTION_FROM="${MAIL_FROM_ADDRESS}"
        EMAIL_EXCEPTION_TO='email1@gmail.com, email2@gmail.com'
        EMAIL_EXCEPTION_CC=''
        EMAIL_EXCEPTION_BCC=''
        EMAIL_EXCEPTION_SUBJECT=''
```

Screenshots
-----------

[](#screenshots)

[![Email Notification](https://camo.githubusercontent.com/52b3350bfa08dab1d9d40a987bf9af94190ec5d5e6f07733c9313eb94f419762/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d657863657074696f6e2d6e6f7469666965722f657863657074696f6e2d6572726f722d656d61696c2d6d696e2e6a706567)](https://camo.githubusercontent.com/52b3350bfa08dab1d9d40a987bf9af94190ec5d5e6f07733c9313eb94f419762/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d657863657074696f6e2d6e6f7469666965722f657863657074696f6e2d6572726f722d656d61696c2d6d696e2e6a706567)

File Tree
---------

[](#file-tree)

```
└── laravel-exception-notifier
    ├── .gitignore
    ├── LICENSE
    ├── composer.json
    ├── readme.md
    └── src
        ├── .env.example
        ├── App
        │   ├── Mail
        │   │   └── ExceptionOccurred.php
        │   └── Traits
        │       └── ExceptionNotificationHandlerTrait.php
        ├── LaravelExceptionNotifier.php
        ├── config
        │   └── exceptions.php
        └── resources
            └── views
                └── emails
                    └── exception.blade.php

```

- Tree command can be installed using brew: `brew install tree`
- File tree generated using command `tree -a -I '.git|node_modules|vendor|storage|tests'`

License
-------

[](#license)

Laravel-Exception-Notifier | A Laravel Exceptions Email Notification Package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance65

Regular maintenance activity

Popularity51

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 56.6% 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 ~307 days

Recently: every ~437 days

Total

11

Last Release

210d ago

Major Versions

v0.0.2 → v1.0.02017-05-19

v1.2.0 → v2.0.12020-03-30

v2.2.0 → v3.0.02022-09-28

v3.1.0 → V4.0.02024-01-21

PHP version history (4 changes)v0.0.2PHP &gt;=5.6.4

v2.0.1PHP ^7.2

v2.2.0PHP ^7.2|^8.0

v3.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/05cef7d9ee65723b129042943511207fb34db74a56afbf67b5900987f758c161?d=identicon)[jeremykenedy](/maintainers/jeremykenedy)

---

Top Contributors

[![jeremykenedy](https://avatars.githubusercontent.com/u/6244570?v=4)](https://github.com/jeremykenedy "jeremykenedy (47 commits)")[![DevDavido](https://avatars.githubusercontent.com/u/997605?v=4)](https://github.com/DevDavido "DevDavido (26 commits)")[![rubicon-international](https://avatars.githubusercontent.com/u/24736813?v=4)](https://github.com/rubicon-international "rubicon-international (9 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

email-notificationemail-notificationsexception-emailexception-emailsexception-handlerexception-messagesexceptionslaravel-exceptionslaravelemailexceptionnotificationexception handlerLaravel Exceptionsemail-notificationsemail-notificationexception-emailexception-emailsexception-messages

### Embed Badge

![Health badge](/badges/jeremykenedy-laravel-exception-notifier/health.svg)

```
[![Health](https://phpackages.com/badges/jeremykenedy-laravel-exception-notifier/health.svg)](https://phpackages.com/packages/jeremykenedy-laravel-exception-notifier)
```

###  Alternatives

[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14642.7k1](/packages/guanguans-laravel-exception-notify)[themonkeys/error-emailer

Emails you whenever an error occurs on your server

4916.6k](/packages/themonkeys-error-emailer)

PHPackages © 2026

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