Download the PHP package laravelsecurityaudit/laravel-mail-preview without Composer
On this page you can find all versions of the php package laravelsecurityaudit/laravel-mail-preview. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravelsecurityaudit/laravel-mail-preview
More information about laravelsecurityaudit/laravel-mail-preview
Files in laravelsecurityaudit/laravel-mail-preview
Package laravel-mail-preview
Short Description Database-backed mail preview inbox for Laravel applications.
License MIT
Homepage https://github.com/laravelsecurityaudit/laravel-mail-preview
Informations about the package laravel-mail-preview
Laravel Mail Preview
Database-backed mail preview inbox for Laravel applications.
Capture every outgoing email your app sends, then browse them in a built-in web UI — no Mailtrap account, no extra SMTP service, and no mail driver swap required.
Why this package
- Works with your existing mail stack — listens to Laravel's
MessageSendingevent instead of replacing mail drivers. - Uses your app's database — captured messages are stored in a normal Eloquent table you can query or prune.
- Self-contained UI — dark-themed inbox with HTML, plain text, headers, and attachment metadata views.
- Safe by default — disabled in production unless you explicitly enable it.
- Laravel 11, 12, and 13 — tested with Orchestra Testbench.
Requirements
- PHP 8.2+
- Laravel 11, 12, or 13
Installation
The package auto-registers its service provider through Laravel package discovery.
Quick start
- Install the package and run migrations.
- In local or staging, open
/_testing/emails(default path). - Trigger any mail send (
Mail::send, notifications, etc.). - Refresh the inbox to inspect captured messages.
The inbox is disabled in production unless you set MAIL_PREVIEW_ENABLED=true.
Configuration
Publish the config when you need to customize defaults:
Environment variables:
DEBUG_MAIL_INBOX_ENABLED is also supported as a backward-compatible enablement flag.
Protecting the inbox
By default, the route uses only the web middleware group. Always protect staging and shared environments.
Publish the config and restrict access:
Register the gate in AppServiceProvider:
Captured emails may contain password reset links, receipts, and other sensitive data. Treat the inbox like application logs.
Publishing assets
What gets captured
Each message stores:
- mailer name, subject, from/to/cc/bcc/reply-to
- rendered HTML and plain-text bodies
- raw headers
- attachment metadata (filename, content type, disposition — not file contents)
- Laravel mail event data keys
Testing
Changelog
See CHANGELOG.md.
License
The MIT License (MIT). Please see LICENSE for more information.
All versions of laravel-mail-preview with dependencies
illuminate/database Version ^11.0 || ^12.0 || ^13.0
illuminate/events Version ^11.0 || ^12.0 || ^13.0
illuminate/http Version ^11.0 || ^12.0 || ^13.0
illuminate/mail Version ^11.0 || ^12.0 || ^13.0
illuminate/routing Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0
illuminate/view Version ^11.0 || ^12.0 || ^13.0
symfony/mime Version ^7.0 || ^8.0