A Laravel mail driver that displays a preview overlay and stores sent emails for local testing.
Laravel Mail Preview is a Laravel package that replaces the default mail transport with a preview driver for local development. It displays a popup overlay with links to sent emails and saves them as files for inspection, solving the problem of testing email content without sending actual messages.
Laravel developers working on applications that send emails and need to preview and test email content during local development.
Developers choose this package because it integrates seamlessly with Laravel's mail system, provides immediate visual feedback, and offers robust testing utilities for asserting email content without relying on external services or actual email delivery.
A mail driver to quickly preview mail
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Displays a popup overlay with direct links to sent emails immediately after dispatch, as shown in the README screenshot, eliminating the need to check logs or files manually.
Provides a SentMails facade for making assertions against email content, which Laravel's built-in Mail::fake lacks, allowing detailed validation of subjects, recipients, and body text in tests.
Automatically saves emails as HTML and EML files in a configurable directory, enabling offline inspection and realistic previews in browsers or email clients without external dependencies.
Offers customization options via a published config file, such as storage paths, popup timeout, and environment-based enabling, giving developers control over the preview experience.
The overlay feature requires adding middleware to the web group and registering a route, making it incompatible with headless Laravel setups or CLI applications where web responses are not available.
Preview files are kept for only 60 seconds maximum by default, which can be too short for extended debugging sessions unless manually configured to persist longer.
Requires multiple steps beyond installation, including modifying mail config, adding middleware, and registering routes, which adds overhead compared to simpler drop-in packages.