Download the PHP package artryazanov/laravel-error-mailer without Composer
On this page you can find all versions of the php package artryazanov/laravel-error-mailer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download artryazanov/laravel-error-mailer
More information about artryazanov/laravel-error-mailer
Files in artryazanov/laravel-error-mailer
Package laravel-error-mailer
Short Description A Laravel package for sending detailed error information via email.
License MIT
Informations about the package laravel-error-mailer
๐ง Laravel Error Mailer
Laravel 11-13 package to automatically send detailed exception reports to configured email addresses. Features a clean HTML template that includes your application's name and environment, full stack traces, comprehensive context data, and built-in rate limiting to prevent spamming your inbox when your application throws repeated errors.
โจ Features
- Clean HTML Template: A clear and readable layout for error reporting.
- Comprehensive Context Capture:
- Web Requests: URL, Method, User info, Request Body, Headers, Cookies, and
$_SERVERarray. - Console Commands (CLI): Command arguments and
$_SERVERarray.
- Web Requests: URL, Method, User info, Request Body, Headers, Cookies, and
- Rate Limiting: Protects your inbox from spam when a recurring error floods your application.
- Smart Email Subjects: The error message is automatically appended to the email subject line (and truncated if too long), making it easy to identify the error at a glance. An optional short hash can be enabled to group similar errors.
- Previous Exceptions: Automatically unwraps and displays previous exceptions in the chain.
๐ Requirements
- PHP 8.2+
- Laravel 11.xโ13.x
๐ฆ Installation
You can install the package via composer:
Laravel auto-discovers the service provider. No manual registration is needed.
โ๏ธ Configuration
Publish the configuration and view files to customize them:
Configuration file: config/error-mailer.php
In your .env file, you can set the following variables:
๐ป Usage
Laravel 11+
In newer Laravel versions, exception handling is configured in bootstrap/app.php. Add the explicit reporting callback inside your withExceptions method:
Older Laravel Versions (or custom Handlers)
If you are using app/Exceptions/Handler.php, you can call the facade in your register method:
๐ก๏ธ Rate Limiting
If your application loses connection to a database or a critical service goes down, it might throw hundreds of exceptions per minute.
This package has built-in Rate Limiting to protect your inbox. By default, it allows sending 15 emails per hour. Any exceptions thrown beyond this limit will be suppressed from the mailer (but a standard Laravel Log::warning will be recorded stating that the email was suppressed).
You can tweak the threshold in your .env using ERROR_MAILER_LIMIT and ERROR_MAILER_WINDOW.
๐งช Local Testing & Preview
If you want to see exactly how the generated emails look without deploying to a live server, this package includes a convenient Docker-based preview script using Mailpit.
-
Start the Mailpit Docker container:
-
Run the preview script to simulate an exception and send the email:
- Open your browser and navigate to http://localhost:18025 to view the rendered HTML email in Mailpit's beautiful web interface.
๐จ Customizing the View
If you published the views, you can find the HTML email template in resources/views/vendor/error-mailer/emails/exception.blade.php. You can modify it to match your company's branding, adjust the layout, or include additional variables.
๐ License
This package is released under the MIT License. See LICENSE for details.
All versions of laravel-error-mailer with dependencies
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/mail Version ^11.0|^12.0|^13.0
illuminate/contracts Version ^11.0|^12.0|^13.0