Skip to content

Mail Web is a Laravel package which catches emails locally for debugging

Notifications You must be signed in to change notification settings

appoly/mail-web

Repository files navigation

MailWeb

A powerful Laravel email debugging and testing tool

Total Downloads Latest Stable Version License

πŸš€ Overview

MailWeb is a robust Laravel package that revolutionizes email development and debugging. It seamlessly captures and displays your application's outgoing emails in real-time, making email testing and sharing effortless.

✨ Features

  • πŸ“§ Real-time Email Interception: Catch and inspect outgoing emails instantly
  • 🎨 Modern UI: Beautiful, responsive interface for easy navigation
  • πŸ” Powerful Search: Quickly find emails with advanced search capabilities
  • πŸ”„ Email Sharing: Share email previews with your team effortlessly
  • πŸ“Ž Attachment Support: Handle email attachments with flexible storage options
  • πŸ›‘οΈ Secure Access Control: Granular control over who can access the dashboard
  • πŸ“± Mobile Responsive: Optimized interface for both desktop and mobile devices

πŸ“‹ Requirements

  • PHP 8.1 or higher
  • Laravel 9.21|10.0|11.0|12.0

πŸ”§ Installation

  1. Install via Composer:
composer require appoly/mail-web
  1. Run migrations:
php artisan migrate
  1. Publish config (if needed):
php artisan vendor:publish --tag=mailweb-config --force

βš™οΈ Configuration

1. Route Registration

Add to your routes file:

Route::mailweb();

2. Access Control

Add to your AppServiceProvider (Laravel 11+) or AuthServiceProvider:

use Illuminate\Support\Facades\Gate;

public function boot()
{
    Gate::define('view-mailweb', function ($user) {
        return in_array($user->email, [
            'admin@example.com',
            // Add authorized emails
        ]);
    });
}

3. Local Development

For local development, set in your .env:

MAIL_MAILER=log

πŸ“ Usage

  1. Access the dashboard at:
{your-app-url}/mailweb
  1. Configure email storage limit in .env:
MAILWEB_LIMIT=30  # Default value
  1. Set up email pruning (recommended in routes/console.php):
use Illuminate\Support\Facades\Schedule;

Schedule::command('mailweb:prune')->daily();

πŸ’Ύ Attachment Storage

Configure attachment storage in your .env:

MAILWEB_ATTACHMENTS_DISK=s3  # Or any configured disk
MAILWEB_ATTACHMENTS_PATH=/custom/path  # Optional, defaults to /mailweb/attachments

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

Local Development Setup

  1. Clone the repository
  2. Install dependencies:
composer install
  1. Link to your test project - add to your test project's composer.json:
{
    "repositories": [
        {
            "type": "path",
            "url": "../path/to/MailWeb",
            "options": {
                "symlink": true
            }
        }
    ],
    "require": {
        "appoly/mail-web": "@dev"
    }
}

πŸ“„ License

This project is licensed under the MIT License.


Made by Appoly