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

Mailtrap Laravel Package

darvis/mailtrap

A Laravel package that integrates Mailtrap into your application, giving you a simple way to route outgoing mail through Mailtrap for safe testing and debugging. Configure it quickly and keep development email isolated from real recipients.

View on GitHub
Deep Wiki
Context7

darvis/mailtrap is a lightweight Laravel package for integrating Mailtrap into your application’s mail workflow. It simplifies configuring Mailtrap as a mail transport, making it easier to capture and inspect outgoing emails during development and testing without accidental delivery.

  • Laravel-native setup via configuration and environment variables
  • Mailtrap transport integration for development and testing
  • Safe email testing without sending to real recipients
  • Minimal configuration for quick adoption
  • Composer-installable package structure
Frequently asked questions about Mailtrap
How do I install Darvis Mailtrap in a Laravel application?
Run composer require darvis/mailtrap, publish the package configuration, add your Mailtrap credentials to the environment, and select the Mailtrap mailer in config/mail.php. Standard transactional mail sent through Laravel's Mail facade should not require application code changes. Check the package README for the exact publish tag and environment variable names.
Which Laravel and PHP versions does darvis/mailtrap support?
The package is intended for Laravel applications on a currently supported PHP 8.x line. The exact Laravel and PHP constraints are defined in its composer.json, so verify them against your application before merging. This is especially important if you are on an older Laravel release or a strict dependency set.
Does Darvis Mailtrap work with Laravel's Mail facade, notifications, and queued mailables?
Yes. It plugs into Laravel's native mailer abstraction rather than introducing a parallel transport, so Mail facade calls, notifications, and queued mailables continue to work. Adoption is mainly configuration and secret management rather than application code changes.
Can I use Darvis Mailtrap only in local and staging environments?
Yes. The package provides configuration helpers for sending mail through Mailtrap in local, staging, or production environments, and it is designed to help teams test messages safely before deployment. Use environment-specific credentials and an explicit switch so development or sandbox traffic cannot be pointed at production recipients.
How does recipient validation work in Darvis Mailtrap?
The package overview states that it validates recipients before sending, which helps catch invalid or unintended addresses in test and staging workflows. The exact validation rules and configuration options are not detailed in the provided overview, so check the package documentation and config after installation. It should not replace application-level validation for production mail.
Does Darvis Mailtrap log outgoing mail and include an inbox UI?
Yes. The package logs every outgoing mail and ships an inbox UI for reviewing captured messages. Treat the inbox as a development or staging tool and restrict access appropriately, since it can contain message contents and metadata.
How do I handle signed Mailtrap webhook events in Laravel?
Darvis Mailtrap processes signed Mailtrap webhook events, so you configure the Mailtrap signing secret and point the webhook endpoint at the package's handler. Verify the documented route, middleware, and secret configuration before exposing it publicly. Keep signature verification enabled so unsigned or tampered requests are rejected.
Can I test mail without hitting the Mailtrap network?
The provided overview does not document a dedicated fake or mock hook for the Mailtrap transport. For application-level mail assertions, Laravel's Mail::fake remains the standard approach, but tests that exercise the Mailtrap integration itself may still need network access unless the package documents an offline mode. Check the package documentation before making CI depend on it.
What are the production risks of using Darvis Mailtrap?
The main risks are a single-maintainer project with bus-factor concerns, reliance on Mailtrap's SaaS for capture, and the common hazard of pointing a development or staging transport at production traffic. Version 1.12.0 is described as a non-behavioral release with Larastan level 8 and typed option reads, which suggests disciplined maintenance. Pin versions and keep mail configuration behind environment switches.
How do I migrate from raw SMTP pointed at Mailtrap to this package?
Replace the raw SMTP settings pointed at Mailtrap with the package's first-party mail transport, then rerun your mail regression tests. Keep the old configuration in place behind an environment switch until the new transport has passed a full test cycle. No domain code changes should be required.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections