- 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.