PHPackages                             alhumsi/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. alhumsi/laravel-error-notifier

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

alhumsi/laravel-error-notifier
==============================

Laravel package for actionable error notifications and auto actions

v1.0.0(5mo ago)12MITPHPPHP &gt;=8.2CI passing

Since Nov 13Pushed 5mo agoCompare

[ Source](https://github.com/Alhumsiabdo/laravel-error-notifier)[ Packagist](https://packagist.org/packages/alhumsi/laravel-error-notifier)[ RSS](/packages/alhumsi-laravel-error-notifier/feed)WikiDiscussions stage Synced 1mo ago

READMEChangelogDependencies (4)Versions (24)Used By (0)

laravel-error-notifier
======================

[](#laravel-error-notifier)

Laravel package for actionable error notifications (Telegram, Slack, Discord) with contextual analysis and actionable suggestions.

Highlights
----------

[](#highlights)

- Auto-wires into Laravel’s exception handler once the service provider boots.
- Ships with Analyzer, MessageFormatter and Notifier abstractions for easy extension.
- Supports Slack, Telegram and Discord out of the box (drop-in HTTP hooks).
- Maps exception types to severity levels and channels, so high-signal alerts stay actionable.
- Ships with MarkdownV2-safe formatting plus JSON context blocks for deeper debugging.

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

[](#screenshots)

SlackTelegramDiscord[![Slack Error](docs/images/slack_error.png)](docs/images/slack_error.png)[![Telegram Error](docs/images/telegram_error.png)](docs/images/telegram_error.png)[![Discord Error](docs/images/discord_error.png)](docs/images/discord_error.png)Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 10.x, 11.x or 12.x (or any app relying on Illuminate components)
- Enabled HTTP client (`Illuminate\Support\Facades\Http`)
- Optional: queue workers if you decide to dispatch notifications asynchronously

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

[](#installation)

```
composer require alhumsi/laravel-error-notifier
php artisan vendor:publish --tag=error-notifier-config
```

Add the following to your `.env` (only the services you plan to use are required):

```
ERROR_NOTIFIER_SLACK_WEBHOOK=https://hooks.slack.com/services/xxx/yyy/zzz
ERROR_NOTIFIER_TELEGRAM_BOT_TOKEN=123456:ABC
ERROR_NOTIFIER_TELEGRAM_CHAT_ID=123456789
ERROR_NOTIFIER_DISCORD_WEBHOOK=https://discord.com/api/webhooks/xxx/yyy
ERROR_NOTIFIER_THROTTLE_ENABLED=true
ERROR_NOTIFIER_MAINTENANCE_ENABLED=false

```

> The package auto-discovers its service provider. No manual edits to `config/app.php` are necessary.

Quickstart
----------

[](#quickstart)

1. Install and publish the config (see above).
2. Adjust `config/error-notifier.php` levels and channels: ```
    'levels' => [
        'emergency' => ['slack', 'telegram'],
        'critical' => ['slack'],
        'error' => ['discord'],
    ];
    ```
3. Map custom exceptions to levels under the `analyzers` array.
4. Trigger any exception in your app; you should see a formatted alert on the configured channel(s).

The package hooks into Laravel’s reportable callback:

```
$this->app->make(\Illuminate\Contracts\Debug\ExceptionHandler::class)
    ->reportable(fn (Throwable $e) => app(ExceptionListener::class)->handle($e));
```

Configuration Essentials
------------------------

[](#configuration-essentials)

- `channels`: provide the transport credentials. Telegram needs `bot_token`, `chat_id` and optional `bot_url`.
- `levels`: severity =&gt; channels mapping. Empty arrays silence that severity.
- `analyzers`: class =&gt; severity override, allowing priority routing for specific exceptions.
- `icons`: severity =&gt; emoji mapping. Customize the visual indicator for each error level.

### Custom Icons

[](#custom-icons)

Define emojis or strings for each severity level in `config/error-notifier.php`:

```
'icons' => [
    'emergency' => '🚨',
    'critical' => '🔥',
    'error' => '❌',
    // ...
],
```

### Custom Analyzer

[](#custom-analyzer)

Implement `alhumsi\ErrorNotifier\Contracts\AnalyzerInterface` and bind it inside a service provider:

```
use alhumsi\ErrorNotifier\Contracts\AnalyzerInterface;
use App\Support\CustomAnalyzer;

public function register()
{
    $this->app->singleton(AnalyzerInterface::class, CustomAnalyzer::class);
}
```

### Custom Formatter

[](#custom-formatter)

Provide your own `MessageFormatterInterface` implementation if you need per-channel formatting tweaks (attachments, embeds, etc.).

### Custom Notifier / Async Delivery

[](#custom-notifier--async-delivery)

Swap `NotifierInterface` with a queue-backed implementation to push payloads to jobs or any other transport you prefer.

Examples
--------

[](#examples)

See the additional guides under `docs/`:

- `docs/getting-started.md`: full walkthrough with publishing, environments and troubleshooting.
- `docs/examples.md`: channel routing, per-project overrides, manual invocation snippets.

Local Testing
-------------

[](#local-testing)

```
composer test
```

Includes an integration test (`tests/ErrorFlowTest.php`) that mocks the notifier and asserts both Slack and Telegram deliveries.

Package Structure
-----------------

[](#package-structure)

```
laravel-error-notifier/
├── config/             # Configuration file
├── docs/               # Additional documentation
├── src/                # Source code
│   ├── Console/
│   │   └── FeatureLockCommand.php
│   ├── Contracts/
│   │   ├── AnalyzerInterface.php
│   │   ├── MessageFormatterInterface.php
│   │   └── NotifierInterface.php
│   ├── Http/
│   │   └── Middleware/
│   │       └── CheckFeatureLock.php
│   ├── Listeners/
│   │   ├── ExceptionListener.php
│   │   └── LogListener.php
│   ├── Services/
│   │   ├── FeatureLocker.php
│   │   └── Maintainer.php
│   ├── Analyzer.php    # Exception analyzer
│   ├── MessageFormatter.php # Notification formatter
│   ├── Notifier.php    # Notification sender
│   └── Throttler.php   # Rate limiting logic
├── tests/              # Automated tests
└── vendor/             # Composer dependencies

```

Contributing
------------

[](#contributing)

1. Fork &amp; clone
2. Run `composer install`
3. Add or adjust tests
4. Open a PR with a summary of changes

License
-------

[](#license)

MIT © Abdullah ALhumsi

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance70

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

169d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5bca4d0b06353df0b28c3be137dc56ec67ca5a13f5520206373e54c28d0439b?d=identicon)[abdullahalhumsi](/maintainers/abdullahalhumsi)

---

Top Contributors

[![Alhumsiabdo](https://avatars.githubusercontent.com/u/136783504?v=4)](https://github.com/Alhumsiabdo "Alhumsiabdo (68 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[beyondcode/laravel-server-timing

Add Server-Timing header information from within your Laravel apps.

5712.0M1](/packages/beyondcode-laravel-server-timing)[rollbar/rollbar-laravel

Rollbar error monitoring integration for Laravel projects

14110.4M7](/packages/rollbar-rollbar-laravel)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[kitloong/laravel-app-logger

Laravel log for your application

101.2M8](/packages/kitloong-laravel-app-logger)[label84/laravel-auth-log

Log user authentication actions in Laravel.

3654.0k](/packages/label84-laravel-auth-log)

PHPackages © 2026

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