PHPackages                             anlutro/l4-smart-errors - 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. anlutro/l4-smart-errors

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

anlutro/l4-smart-errors
=======================

Smart error reporting for Laravel.

2.5.1(9y ago)6515.3k13[2 issues](https://github.com/anlutro/laravel-4-smart-errors/issues)MITPHPPHP &gt;=5.4.0

Since Aug 13Pushed 9y ago2 watchersCompare

[ Source](https://github.com/anlutro/laravel-4-smart-errors)[ Packagist](https://packagist.org/packages/anlutro/l4-smart-errors)[ Docs](https://github.com/anlutro/laravel-4-smart-errors)[ RSS](/packages/anlutro-l4-smart-errors/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (5)Versions (47)Used By (0)

Laravel 4 Smart Errors
======================

[](#laravel-4-smart-errors)

[![Build Status](https://camo.githubusercontent.com/0d6fe3b3ff2ec24c5be6505051c094d7df5d8f4750a6aba3f15e5f09ea35acaf/68747470733a2f2f7472617669732d63692e6f72672f616e6c7574726f2f6c61726176656c2d342d736d6172742d6572726f72732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/anlutro/laravel-4-smart-errors)[![Latest Stable Version](https://camo.githubusercontent.com/ca620cca02ea84b869aa7e0d921d18218d8f9605caa198f43a2ca6f405f78273/68747470733a2f2f706f7365722e707567782e6f72672f616e6c7574726f2f6c342d736d6172742d6572726f72732f762f737461626c652e737667)](https://github.com/anlutro/laravel-4-smart-errors/releases)[![Latest Unstable Version](https://camo.githubusercontent.com/e7e8a450acf406d3df086d0b18ef7560d41806da1802c5c934acca64fade5ac3/68747470733a2f2f706f7365722e707567782e6f72672f616e6c7574726f2f6c342d736d6172742d6572726f72732f762f756e737461626c652e737667)](https://github.com/anlutro/laravel-4-smart-errors/branches/active)[![License](https://camo.githubusercontent.com/fa8f4f5f328a344fa38b79a8d843e9fa64c1bbcce89711138769ceb874cee599/68747470733a2f2f706f7365722e707567782e6f72672f616e6c7574726f2f6c342d736d6172742d6572726f72732f6c6963656e73652e737667)](http://opensource.org/licenses/MIT)

Small system for showing a very generic error message to your end-users while sending an email to yourself with all relevant information about the exception.

[![Example email](https://camo.githubusercontent.com/b495ccc67252a9132b97961ac73db7a5fb2465254f43ac1b7c6c37828352c772/687474703a2f2f692e696d6775722e636f6d2f7949764b3845562e706e67)](https://camo.githubusercontent.com/b495ccc67252a9132b97961ac73db7a5fb2465254f43ac1b7c6c37828352c772/687474703a2f2f692e696d6775722e636f6d2f7949764b3845562e706e67)

- Uncaught exceptions send an email with detailed information (referrer, route name/action, any input given and more)
- 404 errors are written in the log as warnings with the URL accessed + referrer
- Alert-level log events are sent via email (since 1.3)

NOTE: Laravel 5 is not supported. See [this issue](https://github.com/anlutro/laravel-4-smart-errors/issues/24).

Installation
------------

[](#installation)

To install, run `composer require anlutro/l4-smart-errors`. This will pick the most appropriate version and add it to your `composer.json`.

### IMPORTANT: Upgrading from 2.1

[](#important-upgrading-from-21)

Behaviour has changed in 2.2 in a slightly backwards incompatible way. If 'error-view' or 'missing-view' in the config file is set to null, a view response is not returned at all from the error/404 handler. This is in order to let users add their own App::error / App::missing handlers that returns a view with custom data, instead of being forced into using a view composer if you want to use a custom view which requires specific variables to be defined.

To keep behaviour as is in 2.1, make sure the config file is published, then change your config.php file to include the following lines:

```
'error-view' => 'smarterror::generic',
'missing-view' => 'smarterror::missing',

```

Usage
-----

[](#usage)

When the package has been downloaded, add the following to the list of service providers in `app/config/app.php`:

```
'anlutro\L4SmartErrors\L4SmartErrorsServiceProvider',

```

Run `php artisan config:publish anlutro/l4-smart-errors` and open the config file that has been generated. Modify it to your needs. Copy the lang and/or views directories from the vendor directory if you want some templates to work with.

Remove any `App::error` and `App::missing` you may have in your application to prevent conflicts. If you want to handle specific types of exceptions yourself, you can add `App::error` closures with those specific exceptions as arguments. Exceptions handled using `App::error` will not be e-mailed or logged by this package.

### Exception email reports

[](#exception-email-reports)

Exceptions are e-mailed as long as `app.debug` is false, and the `dev-email` key is filled out in the package config file. Make sure that your `mail.php` config file is correct - test it with a regular `Mail::send()`. If your mailer is incorrectly configured, you may get a blank "error in exception handler" screen upon errors.

Email reports are throttled, so that the exact same exception won't be sent over and over again. By default, the threshold for when an identical exception should be emailed again is 10 minutes. This can be configured with the `throttle-age` config key.

Note that emails are not sent when `app.debug` is true.

### End-user responses

[](#end-user-responses)

For any uncaught/unhandled exceptions, the package will return a generic error response to your end users unless `app.debug` is true. If you get this generic response while developing, you might not be setting the correct environment - check your `bootstrap/start.php`.

You can configure which view is displayed with the `error-view`, `missing-view` and `csrf-view` config values. If you set these to `null`, the package will **not** return a generic response to your end users, allowing you to implement your own, as shown in this example:

```
// app/start/global.php
App::pushError(function($exception) {
    if (App::runningInConsole() || Config::get('app.debug')) return;
    return Response::view('my-error-view', [...], 500);
});
```

Using `pushError` instead of `error` makes sure that it's pushed to the end of the exception handler stack, giving the package's error handler priority over yours.

### Localizing the response

[](#localizing-the-response)

This repositories' languages and translations are sporadically updated at best. To ensure that your translation is always up-to-date and/or if you want to manage your translation yourself, run the following commands.

```
mkdir -p ./app/lang/packages/MYLOCALE/smarterror`
cp ./vendor/anlutro/laravel-4-smart-errors/src/lang/en/*.php ./app/lang/packages/MYLOCALE/smarterror

```

You can also copy from a different locale than "en".

If your locale is missing, your generic end-user responses will only have placeholder strings. You can make this default to english by putting `'fallback_locale' => 'en',` into `app/config/app.php`.

Contribution
------------

[](#contribution)

I'll accept language files right away without discussion. For anything else, please be descriptive in your pull requests.

Contact
-------

[](#contact)

Open an issue on GitHub if you have any problems or suggestions.

License
-------

[](#license)

The contents of this repository is released under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 94.4% 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 ~32 days

Recently: every ~217 days

Total

44

Last Release

3312d ago

Major Versions

1.6.1 → 2.0.02013-12-12

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

2.5.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/48f62855097c02888b96494da9a389988cd7ecb9001465f8ec30f15672fb5b5a?d=identicon)[anlutro](/maintainers/anlutro)

---

Top Contributors

[![anlutro](https://avatars.githubusercontent.com/u/163093?v=4)](https://github.com/anlutro "anlutro (152 commits)")[![alxy](https://avatars.githubusercontent.com/u/2057062?v=4)](https://github.com/alxy "alxy (3 commits)")[![Xethron](https://avatars.githubusercontent.com/u/1497338?v=4)](https://github.com/Xethron "Xethron (2 commits)")[![rgomezcasas](https://avatars.githubusercontent.com/u/1331435?v=4)](https://github.com/rgomezcasas "rgomezcasas (1 commits)")[![JayBizzle](https://avatars.githubusercontent.com/u/340752?v=4)](https://github.com/JayBizzle "JayBizzle (1 commits)")[![allaire](https://avatars.githubusercontent.com/u/304461?v=4)](https://github.com/allaire "allaire (1 commits)")[![Johntaa](https://avatars.githubusercontent.com/u/3445006?v=4)](https://github.com/Johntaa "Johntaa (1 commits)")

---

Tags

laravelerror

### Embed Badge

![Health badge](/badges/anlutro-l4-smart-errors/health.svg)

```
[![Health](https://phpackages.com/badges/anlutro-l4-smart-errors/health.svg)](https://phpackages.com/packages/anlutro-l4-smart-errors)
```

###  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).

14844.4k1](/packages/guanguans-laravel-exception-notify)[open-telemetry/opentelemetry-auto-laravel

OpenTelemetry auto-instrumentation for Laravel

592.4M8](/packages/open-telemetry-opentelemetry-auto-laravel)[jenssegers/raven

Sentry (Raven) error monitoring integration for Laravel projects

90197.3k1](/packages/jenssegers-raven)[spatie/laravel-flare

Send Laravel errors to Flare

111.2M6](/packages/spatie-laravel-flare)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21313.7k3](/packages/ecotone-laravel)

PHPackages © 2026

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