Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Extended Errors Laravel Package

swayok/laravel-extended-errors

Laravel Extended Errors enhances Laravel's exception and error handling with richer context, cleaner responses, and flexible customization for APIs and web apps, helping surface useful debugging details while keeping production errors structured and user-friendly.

View on GitHub
Deep Wiki
Context7

Getting Started

The package is installed like any other Laravel package:

composer require swayok/laravel-extended-errors

Laravel's package auto-discovery should register the service provider. Publish whatever configuration it ships with:

php artisan vendor:publish --provider="Swayok\LaravelExtendedErrors\...ServiceProvider"

If the provider isn't auto-discovered (common with low-star packages), add it manually to bootstrap/providers.php (Laravel 11+) or config/app.php.

Where to look first, in order:

  1. README.md — the only authoritative source for the config keys and handler class names. With 1 star and no dependents, don't assume the docs match convention.
  2. config/ after publishing — this tells you which channels are pre-wired and which Monolog handlers exist.
  3. src/ — specifically any *Handler.php and *Formatter.php classes; those are the pieces that plug into config/logging.php.

First use case: richer local debugging. Run APP_DEBUG=true, throw a deliberate exception (e.g. throw new \RuntimeException('test') from php artisan tinker), and compare the rendered page against stock Ignition/Whoops. The package's selling point is "more info" — confirm it actually adds something useful for your workflow (query bindings, request context, environment snapshot) before adopting it elsewhere.

Second use case: HTML error output for logs and mail. Point a logging channel at the package's handler and confirm you get storage/logs/*.html (or an email) that renders the same rich template as your debug page.

Implementation Patterns

Extending the debug page (local/staging only). Treat this exactly like Ignition: it should never run in production. Keep APP_DEBUG=false there and rely on your normal error reporting. In practice this means the debug-page half of the package is a developer-convenience feature only.

Wiring Monolog channels. The package provides a Monolog handler and formatter that produce HTML. The idiomatic integration is a custom channel in config/logging.php:

'channels' => [
    'errors_html' => [
        'driver'  => 'monolog',
        'handler' => \Swayok\LaravelExtendedErrors\...Handler::class,
        'level'   => 'error',
        'with'    => [
            // keys from the package config, e.g. output path
        ],
    ],
],

Because it's a standard Monolog handler, you can compose it with Laravel's tap array or Monolog's own wrapping handlers (FingersCrossedHandler, DeduplicationHandler, BufferHandler).

HTML file logs. A daily-rotating HTML dump is genuinely useful in staging/QA where you want a shareable artifact. Point it at storage/logs/html-errors-YYYY-MM-DD.html and let Laravel's daily rotation apply.

HTML emails for production alerts. Use a stack channel that fans out to the normal file log and the HTML email handler, but throttle aggressively:

'stack' => [
    'driver'   => 'stack',
    'channels' => ['single', 'errors_html_email'],
],

Send only ERROR+ and put a FingersCrossedHandler or a short dedupe window in front of it, otherwise a broken DB connection will mail you on every request.

Laravel 11+ vs. legacy. Handler registration now lives in bootstrap/app.php via ->withExceptions(...) rather than app/Exceptions/Handler.php. Configure the logging channels the same way regardless; just be aware the exception rendering hook (where a debug-page extension lives) is registered through the new Exceptions class.

Queued/spooled mail. HTML error emails composed synchronously block the request that already failed. If the package's handler uses Mail::send, consider subclassing it to dispatch a queued Mailable instead, or wrap it in a transport that writes to a spool file. This is the single biggest "day-to-day" improvement you can make over the stock handler.

Extension points worth knowing. Subclass the package handler, override getFormatter(), and swap in your own template (which is where you'd redact secrets, add a request ID, or link to your internal dashboard). The formatter is the natural seam — everything else is Laravel/Monolog plumbing you already control.

Gotchas and Tips

  • Effectively unmaintained. 1 star, 0 dependents, and a future-dated "last release" (2026-10-23) are red flags. Pin the exact version in composer.json, and wrap usage behind a thin config layer so you can rip it out without touching every channel definition.
  • Monolog v2 vs v3. The handler/formatter APIs changed (constructor signatures, LogRecord vs array). Verify which major version the package targets against your monolog/monolog constraint; a mismatch usually manifests as a TypeError on the first logged error, not at install time.
  • HTML in email clients is a minefield. Gmail strips <style> blocks; Outlook ignores flexbox. If the debug template isn't inlined you'll get a wall of unstyled text. Either inline CSS upstream or accept that it's only readable in a browser.
  • Sensitive data leakage. "More info" means env vars, request bodies, and query bindings — exactly what you don't want in an email, in a log file on disk, or in a shared inbox. Redact at the formatter. Treat the HTML artifacts like secrets and add storage/logs/html-* to backups/retention policies.
  • Email storms and spam. HTML emails with stack traces look like phishing to filters. Use a verified domain, plain-text alternative, and rate limiting. Expect deliverability pain.
  • APP_DEBUG is the switch for the debug-page half. Setting it to true on a reachable server is a remote-injection vector. Never enable it outside local.
  • Config cache. Channel config changes won't apply until php artisan config:clear (or config:cache in deploy). This trips people up constantly with logging.php edits.
  • Log file permissions. If the handler writes as the web user but you tail as a deploy user, or vice versa, you'll get silent write failures — Monolog swallows them. Verify with an ls -la storage/logs after the first trigger.
  • Debugging the logger itself. Throw inside a try/catch, then Log::channel('errors_html')->error(new \Exception('boom')) from tinker to isolate the handler from the framework. If no file appears, the issue is your channel config, not the package.
  • Compare against real alternatives before committing. Flare/Ignition, Sentry, Bugsnag, or a plain stack channel with JSON lines give you most of this with active maintenance. The HTML email idea is nice; the implementation here is a 1-star gamble. Consider borrowing the concept (an HTML formatter on top of FingersCrossedHandler) rather than the dependency.
  • Laravel version drift. Check composer.json constraints; a package this obscure almost certainly doesn't test against the newest Laravel. If you upgrade Laravel, re-run your error-path smoke test explicitly.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin