PHPackages                             nikolaynesov/laravel-serene - 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. nikolaynesov/laravel-serene

ActiveLibrary

nikolaynesov/laravel-serene
===========================

Graceful, noise-free, and rate-limited exception reporting for Laravel

0.0.5(5mo ago)0419MITPHPPHP &gt;=8.1

Since Dec 5Pushed 5mo agoCompare

[ Source](https://github.com/nikolaynesov/laravel-serene)[ Packagist](https://packagist.org/packages/nikolaynesov/laravel-serene)[ RSS](/packages/nikolaynesov-laravel-serene/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (5)Used By (0)

Laravel Serene
==============

[](#laravel-serene)

[![Latest Version on Packagist](https://camo.githubusercontent.com/706da6b3e18d64b2cfe10879507fedec0581bd809125d5c6d13e09b09b25f1eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e696b6f6c61796e65736f762f6c61726176656c2d736572656e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nikolaynesov/laravel-serene)[![Total Downloads](https://camo.githubusercontent.com/d50200a2d56304db509d1beb02ea88aa255ab3d102c88dd426d2c637b0f90686/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e696b6f6c61796e65736f762f6c61726176656c2d736572656e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nikolaynesov/laravel-serene)

Graceful, noise-free, and rate-limited exception reporting for Laravel. Stop spamming your error tracking service with duplicate errors and get meaningful insights into how many times errors occurred and how many users were affected.

Features
--------

[](#features)

- **Rate Limiting**: Automatically throttles duplicate errors to prevent spam
- **Affected User Tracking**: Tracks all users affected by an error during the cooldown period
- **Intelligent Error Grouping**: Interface-based grouping for exceptions with dynamic messages
- **Metrics &amp; Stats**: Provides occurrence and throttle statistics for each error
- **Memory Protection**: Configurable caps prevent cache overflow in catastrophic scenarios
- **Provider Agnostic**: Works with Bugsnag, Sentry, or any custom error reporter
- **Cache Driver Compatible**: Works with any Laravel cache driver (Redis, Memcached, File, etc.)
- **Easy Integration**: Simple facade interface and automatic Laravel discovery

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

[](#installation)

Install the package via Composer:

```
composer require nikolaynesov/laravel-serene
```

The package will automatically register itself via Laravel's package discovery.

### Publish Configuration

[](#publish-configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=serene-config
```

This will create a `config/serene.php` file.

### Environment Variables

[](#environment-variables)

Add these to your `.env` file to configure Serene:

```
# Error reporting cooldown period in minutes (default: 30)
SERENE_REPORTER_COOLDOWN=30

# Enable debug logging (default: false)
SERENE_REPORTER_DEBUG=false

# Maximum users to track per error (default: 1000)
SERENE_REPORTER_MAX_TRACKED_USERS=1000

# Maximum unique errors to track simultaneously (default: 1000)
SERENE_REPORTER_MAX_TRACKED_ERRORS=1000
```

All environment variables are optional. If not set, the defaults shown above will be used.

### Using with Bugsnag

[](#using-with-bugsnag)

If you're using Bugsnag, install the Bugsnag Laravel package:

```
composer require bugsnag/bugsnag-laravel
```

Then configure Bugsnag according to their [documentation](https://docs.bugsnag.com/platforms/php/laravel/).

Set the provider in `config/serene.php`:

```
'provider' => \Nikolaynesov\LaravelSerene\Providers\BugsnagReporter::class,
```

### Using with Laravel Logs

[](#using-with-laravel-logs)

To simply log errors to your Laravel logs:

```
'provider' => \Nikolaynesov\LaravelSerene\Providers\LogReporter::class,
```

Usage
-----

[](#usage)

### Integration with Laravel Exception Handler

[](#integration-with-laravel-exception-handler)

The recommended way to use Serene is to integrate it with Laravel's exception handler. This automatically reports all exceptions with user context:

```
