PHPackages                             jgodstime/laravel-error-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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. jgodstime/laravel-error-notifier

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

jgodstime/laravel-error-notifier
================================

Error notification for laravel

v2.1(2y ago)441.6k3Blade

Since Jul 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/jgodstime/laravel-error-notifier)[ Packagist](https://packagist.org/packages/jgodstime/laravel-error-notifier)[ RSS](/packages/jgodstime-laravel-error-notifier/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (7)Used By (0)

Error Notification For Laravel
==============================

[](#error-notification-for-laravel)

This package sends you email and slack notification whenever 500 internal server errors happens in your application. This package only works for laravel 8, 9 and 10 *This package works for both API and view based laravel project*

[![alt text](https://camo.githubusercontent.com/47b8f85f78e2daf616dcd9757ffe51ec2a3ddd812c804a12acbd560200e16d64/68747470733a2f2f696d673030312e70726e747363722e636f6d2f66696c652f696d673030312f5a6972786b656c3451462d49444246563576317665412e706e67)](https://camo.githubusercontent.com/47b8f85f78e2daf616dcd9757ffe51ec2a3ddd812c804a12acbd560200e16d64/68747470733a2f2f696d673030312e70726e747363722e636f6d2f66696c652f696d673030312f5a6972786b656c3451462d49444246563576317665412e706e67)

What the package sends as a notification
----------------------------------------

[](#what-the-package-sends-as-a-notification)

- Last route the user visited
- If they are authenticated or not
- User ID (If user is authenticated)
- User email (If user is authenticated)
- User error description message (After form is submitted, for a non view based App)
- File Error (The actual file the error was associated with)
- Line Number (The line number the error happened)
- Trace error (The list of files associated with the error; *before and after form is submitted*)

How to install
--------------

[](#how-to-install)

```
composer require jgodstime/laravel-error-notifier

```

In your */app/Exceptions/Handler.php* file, in the register method, add `\ErrorNotifier\Notify\Helper::getError($e);` this must be inside reportable callback

```
    public function register()
    {
    	$this->reportable(function (Throwable  $e)  {
    		 \ErrorNotifier\Notify\Helper::getError($e);
    	});
    }
```

Disable Instant Notification
----------------------------

[](#disable--instant-notification)

By default this package sends notification immediately the error occured i.e without waiting for users description of the error, you can disable this by adding `NOTIFIER_INSTANT=false` in your .env file

### Publishing the vendor files

[](#publishing-the-vendor-files)

By default, Laravel displays the 500 error page in your */views/errors/500.blade.php* file when a 500 error occurs in your application

This package places the 500.blade.php file in the */views/errors/* folder after you publish the vendor file

If you already have a 500.blade.php file in your */views/errors* folder and you want to use this package; you should remove or move it to another folder.

### Publish the vendor files if your app is not API

[](#publish-the-vendor-files-if-your-app-is-not-api)

```
php artisan vendor:publish --provider="ErrorNotifier\Notify\ErrorNotifierServiceProvider"

```

*Now the vendor files are published in their respective paths*

Let's Test
----------

[](#lets-test)

### Setup your email driver

[](#setup-your-email-driver)

> To setup your email driver, you can use [mailtrap](https://mailtrap.io/) for test purpose.

```
    MAIL_DRIVER=smtp
    MAIL_HOST=sandbox.smtp.mailtrap.io
    MAIL_PORT=587
    MAIL_USERNAME=528a733...
    MAIL_PASSWORD=73c29...
    MAIL_ENCRYPTION=tls
    MAIL_FROM_ADDRESS=mygoogle@gmail.com
    MAIL_FROM_NAME="${APP_NAME}"

```

### Disable notification to email

[](#disable-notification-to-email)

> To disable notification to email, set `NOTIFIER_EMAIL=` in your .env file

### Add your slack webhook (Optional)

[](#add-your-slack-webhook-optional)

> To setup your [slack](https://api.slack.com/messaging/webhooks) webhook url

```
LOG_SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T....

```

### We are good 😊

[](#we-are-good-)

To test this, simply add `$array['key1'] = 'john'; $data  = $array['key2'];` in one of your routes, then hit the route In your browser.

```
    Route::get('/convert/file', function(){
    	 $array['key1'] = 'john';
        $data  = $array['key2'];
    });
```

Notice that we are trying to access an array with key2 that doesn’t exist, this will throw an error and the package will send the error as notification to your email as well as the trace.

Also, you must turn `APP_DEBUG=false` and `LOG_LEVEL=debug` in your .env file

**You should see this**

[![alt text](https://camo.githubusercontent.com/47b8f85f78e2daf616dcd9757ffe51ec2a3ddd812c804a12acbd560200e16d64/68747470733a2f2f696d673030312e70726e747363722e636f6d2f66696c652f696d673030312f5a6972786b656c3451462d49444246563576317665412e706e67)](https://camo.githubusercontent.com/47b8f85f78e2daf616dcd9757ffe51ec2a3ddd812c804a12acbd560200e16d64/68747470733a2f2f696d673030312e70726e747363722e636f6d2f66696c652f696d673030312f5a6972786b656c3451462d49444246563576317665412e706e67)

If you don’t have `NOTIFIER_INSTANT=false` in your .env file, the package sends instant notification to the setup email and slack channel

Also, after user submits the form, the package sends another notification with user error description message.

### Modify Page Design

[](#modify-page-design)

You can modify the style for the page to suit your taste,

> **Note:** Be careful not to change the **form route** and **hidden inputs**.

A notification email is sent to the email specified in the laravel environment variable (`MAIL_FROM_ADDRESS`) in your *.env* file

You can change this by adding `NOTIFIER_EMAIL="hello@example.com"` in your .env file.

### Send Email to Multiple Recipients

[](#send-email-to-multiple-recipients)

You can send notification to multiple recipients by adding multiple emails as a string in comma separated format without space

```
NOTIFIER_EMAIL="hello1@example.com,hello2@example.com"

```

### Change Redirect Page URL

[](#change-redirect-page-url)

You can change the page user is taken to after submitting the form, by default it goes to the home page (/)

```
NOTIFIER_REDIRECT_URL='/thank-you'

```

Exciting upgrade coming. Stay tuned!
------------------------------------

[](#exciting-upgrade-coming-stay-tuned)

How can I thank you?
--------------------

[](#how-can-i-thank-you)

Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter, LinkedIn or HackerNews? Spread the word!

Don't forget to [follow me on twitter](https://twitter.com/johngodstime)!

Thanks! Godstime John.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~124 days

Total

3

Last Release

1046d ago

Major Versions

v1.1.2 → v2.12023-08-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e895f4ba812462ec6a3dd23a9f414a2e6d138dfe87dae6c4b8a49d77a84e99c?d=identicon)[jgodstime](/maintainers/jgodstime)

---

Top Contributors

[![jgodstime](https://avatars.githubusercontent.com/u/18240409?v=4)](https://github.com/jgodstime "jgodstime (16 commits)")[![stephenjude](https://avatars.githubusercontent.com/u/31182887?v=4)](https://github.com/stephenjude "stephenjude (2 commits)")

### Embed Badge

![Health badge](/badges/jgodstime-laravel-error-notifier/health.svg)

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M276](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M343](/packages/open-telemetry-sdk)

PHPackages © 2026

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