PHPackages                             redberry/mailbox-for-laravel - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. redberry/mailbox-for-laravel

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

redberry/mailbox-for-laravel
============================

This is my package mailbox-for-laravel

v1.2.0(1mo ago)169.9k↓12.7%1[3 PRs](https://github.com/RedberryProducts/mailbox-for-laravel/pulls)MITPHPPHP ^8.3CI passing

Since Aug 26Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/RedberryProducts/mailbox-for-laravel)[ Packagist](https://packagist.org/packages/redberry/mailbox-for-laravel)[ Docs](https://github.com/redberryproducts/mailbox-for-laravel)[ GitHub Sponsors](https://github.com/Redberry)[ RSS](/packages/redberry-mailbox-for-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (30)Versions (22)Used By (0)

Mailbox for Laravel
===================

[](#mailbox-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/53e3eb67a3666a714660ffbd0d6b44d3b67da450cd1f0b411a8b30e372b9328c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72656462657272792f6d61696c626f782d666f722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/redberry/mailbox-for-laravel)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b6ba83a8eb9b1d958f1a26f7b7c709f3c0eb42576d722585afb7ffe406a9f13d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f526564626572727950726f64756374732f6d61696c626f782d666f722d6c61726176656c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/RedberryProducts/mailbox-for-laravel/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d256224bd49f018a77ac2bd657832ee30cceb37dde015c700db311ecf6b0a29e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f526564626572727950726f64756374732f6d61696c626f782d666f722d6c61726176656c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/RedberryProducts/mailbox-for-laravel/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/91972a51938c1c9cd77fb91c0921bcacc7e26d2c2e723657e8fe4c83f167e758/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72656462657272792f6d61696c626f782d666f722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/redberry/mailbox-for-laravel)

**A zero-configuration local email inbox for Laravel.** Capture, inspect, and test emails without external services—like Mailtrap, but self-contained within your application.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
    - [Dashboard Overview](#dashboard-overview)
    - [Accessing the Dashboard](#accessing-the-dashboard)
    - [API Endpoints](#api-endpoints)
    - [Sending Test Emails](#sending-test-emails)
    - [Message Capture Flow](#message-capture-flow)
    - [Attachments](#attachments)
    - [Clearing the Inbox](#clearing-the-inbox)
- [Frontend Integration](#frontend-integration)
- [Storage Drivers](#storage-drivers)
- [Deploying on Staging / VPS / Docker](#deploying-on-staging--vps--docker)
- [Authorization &amp; Security](#authorization--security)
- [Testing](#testing)
- [Development](#development)
- [Changelog](#changelog)
- [Security Vulnerabilities](#security-vulnerabilities)
- [Credits](#credits)
- [License](#license)

Features
--------

[](#features)

✨ **Core Features:**

- **Local Mailtrap-style inbox** — Capture all outgoing emails in a beautiful web interface
- **Zero external dependencies** — No Mailtrap, Mailhog, or third-party services required
- **Self-contained Inertia.js dashboard** — Vue 3-powered UI that's completely isolated from your host application
- **Works with any frontend stack** — Compatible with Blade-only, Vue, React, Livewire, or existing Inertia apps
- **Multiple storage drivers** — Database (SQLite, MySQL, PostgreSQL) or file-based storage
- **Message normalization** — Structured capture of headers, recipients, attachments, HTML/text bodies
- **Automatic retention policies** — Configure message pruning to prevent disk bloat
- **Authorization middleware** — Gate-based access control for production safety
- **Attachment support** — View and download email attachments
- **Mark as read/unread** — Track which messages you've reviewed
- **Delete functionality** — Clear entire inbox or delete individual messages with confirmation dialogs
- **Responsive UI** — Beautiful TailwindCSS-based interface with dark mode support
- **Developer-friendly** — Auto-enabled in non-production environments
- **Test helpers** — Send test emails directly from the dashboard

Requirements
------------

[](#requirements)

- **PHP:** `^8.3`
- **Laravel:** `^10.0` | `^11.0` | `^12.0`
- **Node.js &amp; NPM:** Required only if rebuilding frontend assets (pre-built assets included)

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

For development environments (recommended):

```
composer require redberry/mailbox-for-laravel --dev
```

For production (if you need to capture emails in production, NOT RECOMMENDED):

```
composer require redberry/mailbox-for-laravel
```

### 2. Run the Installation Command

[](#2-run-the-installation-command)

```
php artisan mailbox:install
```

This command will:

- Publish frontend assets to `public/vendor/mailbox/`
- Run database migrations (creates `mailbox_messages` table by default)
- Set up the necessary configuration

**Available Flags:**

- `--dev` — Link assets for development (watches for file changes)
- `--force` — Force overwrite existing published assets
- `--refresh` — Run `migrate:refresh` instead of `migrate` (⚠️ drops tables)

**Examples:**

```
# Standard installation
php artisan mailbox:install

# Force reinstall (overwrites existing assets)
php artisan mailbox:install --force

# Development mode with linked assets
php artisan mailbox:install --dev

# Fresh install with database reset
php artisan mailbox:install --refresh
```

### 3. Configure Your Mail Driver **Required:**

[](#3-configure-your-mail-driver-required)

Set your mail driver to `mailbox` to capture outgoing emails.

Add to your `.env`:

```
MAIL_MAILER=mailbox
```

### 4. Access the Dashboard

[](#4-access-the-dashboard)

Visit the dashboard at:

```
http://localhost/mailbox

```

Or your configured route (see [Configuration](#configuration)).

> **Note:** The package is auto-discovered by Laravel. No manual service provider registration needed.

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

[](#configuration)

After installation, the configuration file is available at `config/mailbox.php`.

### Configuration Reference

[](#configuration-reference)

```
