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 Mails

Laravel Mails Laravel Package

backstage/laravel-mails

Log, preview, and manage every outgoing Laravel email. This lightweight package stores messages in the database so you can inspect rendered HTML, review recipients and subjects, resend mails, and debug delivery issues in development or production—no more digging through server logs or mail provider...

View on GitHub
Deep Wiki
Context7

backstage/laravel-mails is a Laravel package for capturing and inspecting outgoing email. It hooks into Laravel’s mailer to persist sent messages, so you can review exactly what your app sent without relying on external providers or inboxes.

  • Automatically logs outgoing emails through Laravel mail events
  • Stores recipients, subject, HTML/text bodies, and headers
  • Exposes an Eloquent model and configurable table for custom queries
  • Makes sent mail easy to inspect, search, and debug
  • Fits into existing Laravel apps with minimal setup
Frequently asked questions about Laravel Mails
How do I install backstage/laravel-mails in a Laravel application?
Install it with composer require backstage/laravel-mails, then publish the package config and migrations and run php artisan migrate. In most setups no application code changes are needed, because the package captures mail that already flows through Laravel's standard Mail and notification APIs. Do the first run on a short-lived branch and in staging, review the published schema and indexes, and confirm your existing mailables still send correctly before enabling capture broadly. If the app sends mail through custom SMTP clients or third-party SDKs, verify those paths are captured or they will be invisible in the inbox.
Which Laravel and PHP versions does laravel-mails support?
The authoritative answer is the require block in the package's composer.json, so check that against your exact Laravel and PHP versions before committing. Because it is a Laravel-native package that stores records through Eloquent, you also need a supported relational database such as MySQL, PostgreSQL, or SQLite. Its track record across Laravel major releases is still unproven, so pin a version in composer.json and include the package in your upgrade test matrix rather than relying on automatic compatibility.
Does laravel-mails capture queued mail and notifications, or only Mail::send?
Anything routed through Laravel's mail pipeline, including Mail::send, notifications, and markdown mailables, should be captured, but you should confirm which boundary the package hooks into: mail events, a mailer wrapper, or transport hooks. Be aware that queued mail may be recorded at dispatch time rather than at actual delivery, and job retries can produce duplicate records. Mail sent outside Laravel, such as direct provider API calls from a separate service, will not appear in the inbox at all.
Does laravel-mails store full email bodies and attachments, or only metadata?
The package is built to let you inspect HTML and text versions and review attachments, which implies content storage rather than metadata alone, but the exact scope depends on its published config. Review the migration columns and any size limits or redaction options before enabling it on a high-volume app. Plan for storage growth: large bodies and attachments fit better in LONGTEXT or JSONB columns than in short text fields, and you should decide whether to strip attachments by type or size. Treat captured mail content as sensitive data and restrict access to the inbox routes accordingly.
Is laravel-mails safe to run in production or is it development only?
It can run in production as an audit or observability layer, but only after you accept the trade-offs: extra writes in the mail path, storage of personal data in subjects, recipients, and bodies, and the need for a retention policy. Many teams start with capture enabled in staging and local environments, then extend to production behind a config or feature flag. Measure mail-send latency and database load under realistic volume before rolling out everywhere. If you handle regulated data, get sign-off on what the inbox stores and who can view it.
What happens to mail sending if the package cannot write to the database?
Failure semantics are the key thing to test yourself, because they determine whether mail capture can ever block mail delivery. If persistence is synchronous and the database is unavailable or slow, sending may fail or be delayed. Check whether the published config lets you queue the capture or fail silently, and prefer a setting that degrades gracefully. Simulate an unreachable or read-only database in staging and confirm your application still sends mail.
How do I control retention and redact sensitive data in captured emails?
Review the package config for redaction and retention options and see whether a prune or clean command ships with it. For high-volume tables, add an index on the created timestamp and schedule a job that deletes records past your retention window. Redact at capture time where possible, for example by masking recipients or dropping bodies for sensitive mailables, rather than relying on later cleanup. Confirm migrations are reversible so you can roll the whole feature back cleanly if needed.
Does laravel-mails work with SES, Postmark, Mailgun, and SMTP mailers?
If your app selects those providers through Laravel mailer configuration, capture should work because the package observes Laravel's mail pipeline rather than a specific transport. The risk is custom transports, raw provider SDK calls, or mail sent from non-Laravel services, which bypass the pipeline entirely. Test each configured mailer, including multiple mailer setups and local traps like Mailpit or Mailhog, and verify records appear consistently. Confirm behaviour with attachments and markdown templates too, since those exercise different rendering paths.
Does laravel-mails support multi-tenant applications?
Do not assume built-in tenant isolation; check the published migration for a tenant column or scope before relying on it. In a multi-tenant app, add explicit tenant scoping and authorization on the inbox routes so one tenant can never browse another tenant's captured mail. Per-tenant retention and redaction rules usually need to be implemented on top of the package rather than configured inside it. This is the area most likely to require custom application code.
What are the alternatives to backstage/laravel-mails for previewing emails in Laravel?
Common alternatives are local mail catchers such as Mailpit, Mailhog, or Mailtrap for development, and Laravel Telescope's mail watcher for inspecting recent mail in a running app. Those tools are lightweight but usually ephemeral, whereas laravel-mails adds a persistent in-app inbox with a browser UI for browsing HTML, text, recipients, and attachments. Choose based on whether you need long-lived, searchable mail history inside the application or just quick local debugging. Note that the package has a modest star count and no dependents, so weigh its limited production validation against a more established tool.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect