PHPackages                             ashishdhakal/mail-sandbox - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. ashishdhakal/mail-sandbox

ActiveLibrary[Testing &amp; Quality](/categories/testing)

ashishdhakal/mail-sandbox
=========================

A Laravel package that intercepts outgoing emails and stores them locally for viewing via an in-app web interface.

v1.1.2(3mo ago)3255MITBladePHP ^8.1CI passing

Since Jan 13Pushed 3mo agoCompare

[ Source](https://github.com/Ashish-Dhakal/laravel-mailSandbox-package)[ Packagist](https://packagist.org/packages/ashishdhakal/mail-sandbox)[ RSS](/packages/ashishdhakal-mail-sandbox/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (5)Used By (0)

Mail Sandbox for Laravel
========================

[](#mail-sandbox-for-laravel)

 [![Mail Sandbox Logo](public/assets/logo-white.png)](public/assets/logo-white.png)

A Laravel package that intercepts outgoing emails and stores them locally for viewing via an in-app web interface. This is extremely useful in development environments – instead of sending real emails, you can capture them and inspect their content in a browser.

Prerequisites
-------------

[](#prerequisites)

- PHP v8.1+
- Laravel 10+

Features
--------

[](#features)

- Intercepts all outgoing emails.
- Stores emails in a local database.
- Web interface to list and view captured emails.
- Configurable route prefix and middleware.
- Easy to enable/disable via environment variables.

Installation
------------

[](#installation)

1. Install the package via Composer:

```
composer require ashishdhakal/mail-sandbox
```

2. Publish the configuration and migrations (optional):

```
php artisan vendor:publish --tag=mail-sandbox-config
php artisan vendor:publish --tag=mail-sandbox-migrations
```

3. Run the migrations:

```
php artisan migrate
```

Configuration
-------------

[](#configuration)

You can configure the package in `config/mail-sandbox.php`:

```
return [
    'capture_enabled' => env('MAIL_SANDBOX_CAPTURE', config('app.env') !== 'production'),
    'ui_enabled' => env('MAIL_SANDBOX_UI', config('app.env') !== 'production'),
    'path' => 'mail-sandbox',
    'middleware' => ['web'],
];
```

### Configure Mailer

[](#configure-mailer)

Add the custom driver to your `config/mail.php`:

```
'mailers' => [
    'sandbox' => [
        'transport' => 'sandbox',
    ],
],
```

### Update .env

[](#update-env)

Update your `.env` to activate it:

```
MAIL_MAILER=sandbox
```

Usage
-----

[](#usage)

Once installed and enabled, any email sent by your application will be intercepted and stored.

### Accessing the Interface

[](#accessing-the-interface)

You can view the intercepted emails at:

```
/mail-sandbox

```

For example: `http://your-app.test/mail-sandbox` or `http://localhost:8000/mail-sandbox`

Testing
-------

[](#testing)

To run the package's test suite, ensure you have installed the dev dependencies and run:

```
composer test
```

The tests are powered by [Pest](https://pestphp.com/).

Credits
-------

[](#credits)

- Ashish Dhakal ()

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance78

Regular maintenance activity

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

118d ago

PHP version history (2 changes)v1.0.0PHP ^8.2

v1.1.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/97772881?v=4)[Ashish Dhakal](/maintainers/Ashish-Dhakal)[@Ashish-Dhakal](https://github.com/Ashish-Dhakal)

---

Top Contributors

[![Ashish-Dhakal](https://avatars.githubusercontent.com/u/97772881?v=4)](https://github.com/Ashish-Dhakal "Ashish-Dhakal (7 commits)")

---

Tags

testinglaravelemaildevelopmentsandboxmail-interceptor

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/ashishdhakal-mail-sandbox/health.svg)

```
[![Health](https://phpackages.com/badges/ashishdhakal-mail-sandbox/health.svg)](https://phpackages.com/packages/ashishdhakal-mail-sandbox)
```

###  Alternatives

[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[laracasts/testdummy

Easy test stubs

4671.4M36](/packages/laracasts-testdummy)[davestewart/sketchpad

An innovative front-end environment for interactive Laravel development

29512.9k1](/packages/davestewart-sketchpad)[srlabs/laravel-testing-utilities

Helper utilities for testing Laravel Applications

1011.9k](/packages/srlabs-laravel-testing-utilities)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
