PHPackages                             webmaster-hm/lern81 - 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. webmaster-hm/lern81

ActiveLaravel-package[Logging &amp; Monitoring](/categories/logging)

webmaster-hm/lern81
===================

LERN (Laravel Exception Recorder and Notifier) is a Laravel 5 package that will record exceptions into a database and will notify you via Email, Pushover or Slack.

v1.0.10(6mo ago)0360MITPHPPHP ^8.1|^8.2|^8.3|^8.4

Since Dec 3Pushed 6mo agoCompare

[ Source](https://github.com/webmaster-hm/lern81)[ Packagist](https://packagist.org/packages/webmaster-hm/lern81)[ Docs](https://github.com/webmaster-hm/lern81)[ RSS](/packages/webmaster-hm-lern81/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (12)Used By (0)

LERN (Laravel Exception Recorder and Notifier)
==============================================

[](#lern-laravel-exception-recorder-and-notifier)

[![Latest Version](https://camo.githubusercontent.com/ea8b30a70f11314aea32f28acc5ffb018276cccc37096e7bb8664652630a54cf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f74796c657263643130302f6c65726e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/tylercd100/lern/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/d72152d257ba375eb1cfdb9b9cd648a55c2be4efa2a9ea740a5c14ce95cd9277/68747470733a2f2f7472617669732d63692e6f72672f74796c657263643130302f6c65726e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tylercd100/lern)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/33d6ce7ad0ea55ab6eeae31e830f5e890f654884422bb44978da31ab266cf21b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f74796c657263643130302f6c65726e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/tylercd100/lern/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/757989dbc5959d61a3a6cd9ef8db7d2ac52c16dfe09c647156586f549ca6c3d9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f74796c657263643130302f6c65726e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/tylercd100/lern/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/5a94b7d2519ffbcc28e5544a44fe17e512a889169d5b459394b263d4631ed106/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74796c657263643130302f6c65726e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tylercd100/lern)

***LERN from your mistakes***

LERN is a Laravel 5 package that will record exceptions into a database and will send you a notification.

Currently supported notification channels via [Monolog](https://github.com/Seldaek/monolog)

- Email
- [Pushover](https://pushover.net/)
- [Slack](https://slack.com/)
- [Fleephook](https://fleep.io/)
- [Flowdock](https://www.flowdock.com/)
- [Plivo](https://www.plivo.com/) an SMS messaging service.
- [Twilio](https://www.twilio.com/) an SMS messaging service.
- [Sentry](https://getsentry.com) via [Sentry SDK for PHP](https://github.com/getsentry/sentry-php)
- [Mailgun](https://mailgun.com)

Version Compatibility
---------------------

[](#version-compatibility)

LaravelLERN5.1.x3.x5.2.x3.x5.3.x3.x5.4.x3.x5.5.x4.x5.6.x4.x6.x5.x and 6.x7.x6.x8.x6.xMigrating from `3.x` to `4.x`
-----------------------------

[](#migrating-from-3x-to-4x)

Make sure that the config file now includes the new `lern.notify.class` and `lern.record.class` settings. Check the [config file](https://github.com/tylercd100/lern/blob/master/config/lern.php) to see how they are used.

Migrating from `2.x` to `3.x`
-----------------------------

[](#migrating-from-2x-to-3x)

Version 3.x introduces the ability to collect more information from the error such as the user\_id, url, method, and input data. In order to use 3.x you will need to copy over the new [config file](https://github.com/tylercd100/lern/blob/master/config/lern.php), the migration file and then migrate it.

```
# This will only copy over the migration file. For the config file you can either include the --force flag (Which will overwrite it) or copy it manually from github
php artisan vendor:publish --provider="Tylercd100\LERN\LERNServiceProvider"
php artisan migrate
```

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

[](#installation)

Version 4.x uses [Package Discovery](https://laravel.com/docs/5.5/packages#package-discovery). If you are using 3.x you will need to follow these [instructions.](https://github.com/tylercd100/lern/tree/3.8.2)

Install via [composer](https://getcomposer.org/) - In the terminal:

```
composer require tylercd100/lern
```

Then you will need to run these commands in the terminal in order to copy the config and migration files

```
php artisan vendor:publish --provider="Tylercd100\LERN\LERNServiceProvider"
```

Before you run the migration you may want to take a look at `config/lern.php` and change the `table` property to a table name that you would like to use. After that run the migration

```
php artisan migrate
```

Usage
-----

[](#usage)

To use LERN modify the report method in the `app/Exceptions/Handler.php` file

```
public function report(Throwable $e)
{
    if ($this->shouldReport($e)) {

    	//Check to see if LERN is installed otherwise you will not get an exception.
        if (app()->bound("lern")) {
            app()->make("lern")->handle($e); //Record and Notify the Exception

            /*
            OR...
            app()->make("lern")->record($e); //Record the Exception to the database
            app()->make("lern")->notify($e); //Notify the Exception
            */
        }
    }

    return parent::report($e);
}
```

Dont forget to add this to the top of the file

```
//If you updated your aliases array in "config/app.php"
use LERN;
use Throwable;
//or if you didnt...
use Tylercd100\LERN\Facades\LERN;
use Throwable;
```

### Recording

[](#recording)

You can call `LERN::record($exception);` to record an Exception to the database. To query any Exception that has been recorded you can use `ExceptionModel` which is an Eloquent Model

```
use Tylercd100\LERN\Models\ExceptionModel;
$mostRecentException = ExceptionModel::orderBy('created_at','DESC')->first();
```

To change what is recorded in to the database take a look at `config/lern.php`

```
'record'=>[
    /**
     * The Model to use
     */
    'model' => \Tylercd100\LERN\Models\ExceptionModel::class,

    /**
     * Database connection to use. Null is the default connection.
     */
    'connection'=>null,

    /**
     * Database table to use
     */
    'table'=>'vendor_tylercd100_lern_exceptions',

    /**
     * Information to store
     */
	'collect'=>[
	    'method'=>false, //When true it will collect GET, POST, DELETE, PUT, etc...
	    'data'=>false, //When true it will collect Input data
	    'status_code'=>true,
	    'user_id'=>false,
	    'url'=>false,
        'ip'=>false,
	],
],
```

Note: If you change `lern.recorder.model` then `lern.recorder.table` and `lern.recorder.connection` will be ignored unless you extend `\Tylercd100\LERN\Models\ExceptionModel::class`

### Notifications

[](#notifications)

LERN uses the Monolog library to send notifications. If you need more than the supported notification channels, then you can add your own custom Monolog handlers. To start using any of the supported handlers just edit the provided config file `config/lern.php`.

#### Changing the log level programmatically

[](#changing-the-log-level-programmatically)

Some notification services support different log levels. If changing the config value `lern.notify.log_level` is not enough then try it this way:

```
// Change the log level.
// Default is: critical
// Options are: debug, info, notice, warning, error, critical, alert, emergency
LERN::setLogLevel("emergency");
```

#### Changing the subject line

[](#changing-the-subject-line)

Some notification services support a subject line, this is how you change it.

```
//Change the subject
LERN::setSubject("An Exception was thrown!");
```

#### Changing the body of the notification

[](#changing-the-body-of-the-notification)

LERN publishes a default blade template file that you can find at `resources/views/exceptions/default.blade.php`. The blade template file is compiled with these values: `$exception` `$url` `$method` `$data` `$user`. To specify a different blade template file, just edit the config file

```
'notify'=>[
    'view'=>'exceptions.default',
],
```

##### (deprecated) Using the `LERN::setMessage()` function

[](#deprecated-using-the-lernsetmessage-function)

Make sure that you set the view config value to null or the `LERN::setMessage()` will not work

```
'notify'=>[
    'view'=>null,
],
```

#### Custom Monolog Handlers

[](#custom-monolog-handlers)

To use a custom Monolog Handler call the `pushHandler` method

```
use Monolog\Handler\SlackHandler;
$handler = new SlackHandler($token, $channel);
LERN::pushHandler($handler);
LERN::notify($exception);
```

Further Reading and How-Tos
---------------------------

[](#further-reading-and-how-tos)

- [Creating relationships between Exceptions and Users](https://github.com/tylercd100/lern/wiki/Creating-relationships-between-exceptions-and-users)

Roadmap
-------

[](#roadmap)

- Support more Monolog Handlers
- Exception report page or command to easily identify your application's issues.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance67

Regular maintenance activity

Popularity12

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 92.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 ~179 days

Recently: every ~168 days

Total

11

Last Release

191d ago

PHP version history (3 changes)v1.0.0PHP ^7.2|^8.0

v1.0.1PHP ^7.2|^8.0|^8.1

v1.0.9PHP ^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5a60777622e7890245cb03c5ebcdd85a30d2a4f8091cd0696b0f3c4e5308cee?d=identicon)[webmaster-hm](/maintainers/webmaster-hm)

---

Top Contributors

[![tylercd100](https://avatars.githubusercontent.com/u/4522226?v=4)](https://github.com/tylercd100 "tylercd100 (231 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (8 commits)")[![vincentmendiola](https://avatars.githubusercontent.com/u/5439242?v=4)](https://github.com/vincentmendiola "vincentmendiola (2 commits)")[![leamasuero](https://avatars.githubusercontent.com/u/3332647?v=4)](https://github.com/leamasuero "leamasuero (1 commits)")[![robbielove](https://avatars.githubusercontent.com/u/13571547?v=4)](https://github.com/robbielove "robbielove (1 commits)")[![fishisawesome](https://avatars.githubusercontent.com/u/6018584?v=4)](https://github.com/fishisawesome "fishisawesome (1 commits)")[![sroutier](https://avatars.githubusercontent.com/u/3011606?v=4)](https://github.com/sroutier "sroutier (1 commits)")[![tmdh](https://avatars.githubusercontent.com/u/18123729?v=4)](https://github.com/tmdh "tmdh (1 commits)")[![tortuetorche](https://avatars.githubusercontent.com/u/5038872?v=4)](https://github.com/tortuetorche "tortuetorche (1 commits)")[![smallhadroncollider](https://avatars.githubusercontent.com/u/477286?v=4)](https://github.com/smallhadroncollider "smallhadroncollider (1 commits)")[![fosron](https://avatars.githubusercontent.com/u/3708631?v=4)](https://github.com/fosron "fosron (1 commits)")[![iamlucianojr](https://avatars.githubusercontent.com/u/3333167?v=4)](https://github.com/iamlucianojr "iamlucianojr (1 commits)")

---

Tags

laravelslackexceptionsmonologtylercd100pushoverlern

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/webmaster-hm-lern81/health.svg)

```
[![Health](https://phpackages.com/badges/webmaster-hm-lern81/health.svg)](https://phpackages.com/packages/webmaster-hm-lern81)
```

###  Alternatives

[tylercd100/lern

LERN (Laravel Exception Recorder and Notifier) is a Laravel 5 package that will record exceptions into a database and will notify you via Email, Pushover or Slack.

438153.4k3](/packages/tylercd100-lern)[bugsnag/bugsnag-laravel

Official Bugsnag notifier for Laravel applications.

90234.6M36](/packages/bugsnag-bugsnag-laravel)[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)[tylercd100/laravel-notify

12152.1k1](/packages/tylercd100-laravel-notify)[naoray/laravel-github-monolog

Log driver to store logs as github issues

10619.4k](/packages/naoray-laravel-github-monolog)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

1286.2k](/packages/shaffe-laravel-mail-log-channel)

PHPackages © 2026

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