PHPackages                             isaidgitmenow/laravel-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. isaidgitmenow/laravel-errors

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

isaidgitmenow/laravel-errors
============================

Enterprise-grade, highly configurable error handling for Laravel 13.

00PHPCI failing

Since Jun 18Pushed todayCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Errors 🚨
================

[](#laravel-errors-)

[![Latest Version on Packagist](https://camo.githubusercontent.com/438a2ef85570d6bc9ce257e3fb0d1b1e950a8a989dcb684c92bc7b5714c00386/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69736169646769746d656e6f772f6c61726176656c2d6572726f72732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/isaidgitmenow/laravel-errors)[![Total Downloads](https://camo.githubusercontent.com/6733b392c539e14a5eb557da686d322218dc1454b6367287834e5d022d44e03e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f69736169646769746d656e6f772f6c61726176656c2d6572726f72732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/isaidgitmenow/laravel-errors)[![Tests](https://camo.githubusercontent.com/7d147abb35d8a53f5a3c99ea30166fc046023bf6335a957f15a18e5ec9777344/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f69736169646769746d656e6f772f6c61726176656c2d6572726f72732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/isaidgitmenow/laravel-errors/actions/workflows/run-tests.yml)

```
composer require isaidgitmenow/laravel-errors
```

A powerful, elegant, and declarative error handling package for modern Laravel applications (Laravel 11+).

Built with **PHP 8.4+ Attributes** and strictly adhering to **SOLID principles**, this package replaces traditional, boilerplate-heavy exception rendering and reporting methods with clean, declarative attributes directly on your Exception classes.

✨ Features
----------

[](#-features)

- **Declarative PHP 8 Attributes**: Configure HTTP codes, reporting rules, rate limiting, and context directly on your exception classes.
- **Plug-and-Play Frontend Integrations**: Automatically detects the context of the request (**Filament, Livewire, Inertia, API, Web**) and formats the response appropriately so your SPA or Admin panel doesn't break on a 500 error.
- **Bulletproof Resilience**: Includes a self-healing `try/catch` wrapper so an error in your error handler never causes a White Screen of Death (WSOD).
- **Deep Attribute Inspection**: Safely traverses Laravel's wrapped exceptions (e.g., `QueryException`, `ViewException`) to find and apply your custom attributes on the original exception.
- **Spatie Ignition &amp; Laravel Debugbar Ready**: Seamlessly integrates with local developer tools without breaking production flows.
- **Xdebug IDE Enrichment**: Push sanitized `#[WithContext]` payloads directly to your IDE as debug notifications.
- **Auto-Injection into Laravel Context**: Automatically forwards `#[WithContext]` data to downstream trackers like Sentry or Flare via Laravel 11's global `Context`.
- **Data Sanitization**: Built-in redaction for sensitive keys (like passwords and API tokens) before they hit logs or external trackers.
- **Anti-Spam Rate Limiting**: Prevent cascading failures from exhausting your error tracker quotas using the `#[RateLimit]` attribute.
- **Octane Compatible**: Automatically flushes the reflection cache and dynamic state after every request under Swoole / RoadRunner to prevent memory leaks.
- **Dynamic Pass-Through**: Third-party packages can register exceptions to bypass the pipeline at runtime — no config edits required.
- **Fallback Logging**: Ensures your application never runs completely blind by falling back to Laravel's default logger if no reporters are configured — whether via config or dynamically via `addReporter()`.
- **Environment-Specific Reporting**: Restrict `#[ReportTo]` to specific environments (e.g., only send Slack alerts in `production`).
- **`make:error` Artisan Command**: Scaffold fully decorated exception classes in seconds with `php artisan make:error`.
- **Static Analysis Ready**: Ships with a `phpstan.neon.dist` pre-configured for [Larastan](https://github.com/larastan/larastan) level 5.
- **MCP Server Built-in**: Includes a native Model Context Protocol (MCP) server so your AI agent can create, inspect, and simulate errors straight from your IDE.
- **CI/CD Ready**: Includes a GitHub Actions workflow matrix covering PHP 8.4/8.5 × Laravel 11/12.

📦 Requirements
--------------

[](#-requirements)

- PHP 8.4+
- Laravel 11.0+

🚀 Installation &amp; Setup
--------------------------

[](#-installation--setup)

You can install the package via composer:

```
composer require isaidgitmenow/laravel-errors
```

Optionally, publish the configuration file to customize the pipeline:

```
php artisan vendor:publish --tag="laravel-errors-config"
```

Integration is incredibly simple. Open your `bootstrap/app.php` and register the handler:

```
// bootstrap/app.php
use Illuminate\Foundation\Configuration\Exceptions;
use Isaidgitmenow\LaravelErrors\ErrorHandler;

return Application::configure(basePath: dirname(__DIR__))
    // ...
    ->withExceptions(function (Exceptions $exceptions) {
        // Let the package orchestrate your entire error pipeline:
        ErrorHandler::handle($exceptions);
    })->create();
```

---

📚 Documentation
---------------

[](#-documentation)

For detailed usage and advanced configuration, please refer to the specific documentation chapters:

### [Core Architecture And Api](docs/01-core-architecture-and-api.md)

[](#core-architecture-and-api)

- 🏗️ Core Architecture &amp; API Reference
- 🕵️‍♂️ How Does It Know the Request Context?
- 🚀 The Complete Lifecycle: Generating, Throwing &amp; Logging

### [Usage And Attributes](docs/02-usage-and-attributes.md)

[](#usage-and-attributes)

- 📖 Usage: The Attributes API
- 💡 The Ultimate Exception Example
- 🤔 Do I Still Need `try/catch`?

### [Renderers](docs/03-renderers.md)

[](#renderers)

- 🎨 Context Detectors &amp; Renderers
- 🌐 Web Renderer Example
- 📡 API Renderer Example
- ⚡ Livewire Renderer Example
- 🛡️ Filament Renderer Example
- ⚛️ Inertia.js Renderer Example

### [Reporters And Integrations](docs/04-reporters-and-integrations.md)

[](#reporters-and-integrations)

- 📢 Reporters
- 💬 Slack Integration Example
- 🦉 NightWatch Integration Example
- 💥 Flare (or Sentry) Integration
- 🐛 Laravel Debugbar Integration Example
- 🐞 Xdebug IDE Enrichment
- 🔀 Routing to Different Log Channels
- 🌍 Environment-Specific Reporting

### [Exception Handling Mechanics](docs/05-exception-handling-mechanics.md)

[](#exception-handling-mechanics)

- 🚧 Bypassing the Pipeline: Native Laravel Exceptions
- 🚦 The "Pass Through" Exceptions (Complete List)
- 🤷‍♂️ Handling Generic (Un-decorated) Exceptions
- 📝 A Note on API Form Requests (`ValidationException`)
- 🛡️ Working with Gates &amp; Permissions (`AuthorizationException`)
- 🌍 Translated Error Messages Example

### [Advanced Configuration And Patterns](docs/06-advanced-configuration-and-patterns.md)

[](#advanced-configuration-and-patterns)

- ⚙️ Advanced Configuration &amp; Mechanics
- 🧩 Custom Detectors, Renderers, and Reporters
- 🏗️ Building a Custom Detector (Step-by-Step)
- 🛑 Anti-Spam: Error Rate Limiting (In-Depth)
- ⚡ Performance &amp; Error Cache (Octane / Testing)
- 🤯 Exotic Use Cases &amp; Advanced Patterns
- 🌐 Advanced API: Complying with JSON:API Specification

### [Ecosystem And Commands](docs/07-ecosystem-and-commands.md)

[](#ecosystem-and-commands)

- ⚙️ Queue Jobs Integration
- 💻 Artisan Commands Integration
- 🛠️ Generating Exceptions: `make:error`
- 🏗️ Domain Driven Design (DDD) Support

### [Testing And Ci](docs/08-testing-and-ci.md)

[](#testing-and-ci)

- 🧪 Testing Your Application
- 🔬 Static Analysis with Larastan
- 🤖 Continuous Integration (GitHub Actions)

---

🤖 AI Agent Integration (MCP Server)
-----------------------------------

[](#-ai-agent-integration-mcp-server)

This package ships with a native **Model Context Protocol (MCP)** server, meaning your favorite AI coding assistant (like Claude Desktop, Cursor, or Antigravity) can connect directly to your local error pipeline.

With the MCP integration enabled, your AI can:

- **Generate Exceptions:** Ask your AI to "Create a `PaymentFailed` error with a 402 status that reports to Slack", and it will use the MCP tool to generate the fully decorated file.
- **Inspect Pipeline:** The AI can query your active Detectors, Renderers, and Reporters.
- **Search Logs:** The AI can query your application's historical JSONL error logs directly to help you debug past errors.
- **Simulate Errors:** The AI can instantiate and run exceptions through the pipeline in a rolled-back transaction to verify how they behave.

### Setup

[](#setup)

To connect your AI agent, add the following configuration to your client's `mcp_config.json` (or `claude_desktop_config.json`):

```
{
  "mcpServers": {
    "laravel-errors-mcp": {
      "command": "cmd",
      "args": [
        "/c",
        "cd /path/to/your/project && php artisan errors:mcp"
      ]
    }
  }
}
```

*(If you are on Linux or macOS, simply use `bash` and `-c` instead of `cmd` and `/c`)*

---

🧪 Testing
---------

[](#-testing)

The package includes a comprehensive test suite (built with Pest and Orchestra Testbench).

```
composer test
```

Run static analysis with Larastan:

```
composer phpstan
```

---

📜 License
---------

[](#-license)

This package is **Dual Licensed**:

- **Open Source (GPLv3):** Free for personal or open-source projects. If you use this package, your application must also be open-source under the GPLv3.
- **Commercial Use:** If you are building a commercial, proprietary, or closed-source application, you **must** purchase a Commercial License.

### Purchase a License

[](#purchase-a-license)

To purchase a Commercial License, please visit **[unicweb.ro](https://unicweb.ro)** or contact **** for inquiries.

Please read the full [LICENSE Agreement](LICENSE) for complete details.

---

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/81811775?v=4)[isaidgitmenow](/maintainers/isaidgitmenow)[@isaidgitmenow](https://github.com/isaidgitmenow)

---

Top Contributors

[![isaidgitmenow](https://avatars.githubusercontent.com/u/81811775?v=4)](https://github.com/isaidgitmenow "isaidgitmenow (48 commits)")

---

Tags

errorslaravelphp

### Embed Badge

![Health badge](/badges/isaidgitmenow-laravel-errors/health.svg)

```
[![Health](https://phpackages.com/badges/isaidgitmenow-laravel-errors/health.svg)](https://phpackages.com/packages/isaidgitmenow-laravel-errors)
```

###  Alternatives

[psr/log

Common interface for logging libraries

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

API for OpenTelemetry PHP.

1938.5M261](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2326.5M315](/packages/open-telemetry-sdk)[illuminated/console-logger

Logging and Notifications for Laravel Console Commands.

8676.7k](/packages/illuminated-console-logger)[relaxart/monolog-docker-handler

Docker handler for monolog

1442.6k](/packages/relaxart-monolog-docker-handler)

PHPackages © 2026

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