rulr/laravel-mailpot
最新稳定版本:v1.1.0
Composer 安装命令:
composer require rulr/laravel-mailpot
包简介
A local mail inbox for Laravel
关键字:
README 文档
README
A local mail inbox for Laravel. No external tools or services required. Mailpot lets you intercept, store, and inspect emails sent during development.
Think of it like Mailtrap or Mailhog, but fully embedded in your Laravel app. No Docker, no SMTP config, no fuss.
Features
- Stores sent mails as
.jsonfiles - Clean inbox UI built with Tailwind and Alpine.js
- Read/unread tracking (client-side, no database required)
- Resizable viewport preview (mobile, tablet, desktop)
- Stats: message count, storage size, largest/smallest message
- Artisan commands for cleaning inbox and viewing stats
- Configurable storage path
- No third-party tools or services
- Compatible with Laravel 10, 11, and 12
Installation
composer require --dev rulr/laravel-mailpot
This package is intended for local development only.
Mail Configuration
Update your config/mail.php file to add the mailpot mailer:
'mailers' => [ 'mailpot' => [ 'transport' => 'mailpot', ], // ... ],
Set the mailer in your .env file:
MAIL_MAILER=mailpot
Publishing Configuration
To customize the storage path, publish the configuration file:
php artisan vendor:publish --tag=mailpot-config
This creates config/mailpot.php with the following options:
return [ 'storage_path' => env('MAILPOT_STORAGE_PATH', storage_path('framework/mailpot')), ];
You can set a custom path in your .env file:
MAILPOT_STORAGE_PATH=/path/to/custom/mailpot
If not configured, messages are stored in storage/framework/mailpot.
Web UI
Visit the inbox in your browser:
http://localhost:8000/mailpot
The interface allows you to:
- Browse and read emails with subject, from, to, date, and content
- Switch between mobile, tablet, and desktop viewport sizes
- Resize the viewport manually for custom widths
- Track read/unread status (stored in browser localStorage)
- View inbox statistics when no email is selected
The web UI is only available when APP_ENV=local.
Artisan Commands
Show Stats
php artisan mailpot:stats
Displays a summary of:
- Total message count
- Total inbox size
- Largest and smallest message
- Latest message details
Clean Inbox
php artisan mailpot:clean
Deletes all stored messages. You will be prompted to optionally delete the stats file as well.
Testing
This package uses Orchestra Testbench.
Run tests with:
composer test
Or directly:
./vendor/bin/phpunit
Code Quality
Run static analysis:
./vendor/bin/phpstan analyse
Run code style fixes:
./vendor/bin/pint
Files and Storage
Messages are saved to the configured storage path (default: storage/framework/mailpot).
- Each email is stored as a
.jsonfile stats.jsoncontains cached statistics.gitignoreis auto-generated to exclude messages from Git
Recommended .gitignore
/vendor /.phpunit.result.cache /storage/framework/mailpot/* !/storage/framework/mailpot/.gitignore
License
MIT. See LICENSE.md
Contributing
Feel free to submit PRs or open issues. Bug fixes, ideas, and improvements are welcome.
Credits
Created by Rulr for Laravel developers who want email to work locally.
统计信息
- 总下载量: 1.04k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-11
