承接 masterro/laravel-mail-viewer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

masterro/laravel-mail-viewer

Composer 安装命令:

composer require masterro/laravel-mail-viewer

包简介

Easily view in browser outgoing emails.

README 文档

README

Latest Stable Version Total Downloads License

StandWithUkraine

Laravel Mail Viewer

Easily log, view, and search outgoing emails directly in your browser.

Screenshot of Laravel Mail Viewer - Light Mode Screenshot of Laravel Mail Viewer - Dark Mode

This package logs all outgoing emails to a database and provides a web interface to view them, formatted as they appear in modern email clients like Gmail.

Features

  • Logs all outgoing emails to the database
  • Modern in-browser email viewer
  • Searchable UI with auto-refreshing entries
  • Configurable route and access protection
  • Optional email pruning

Installation

Step 1: Install via Composer

Run the following command in your terminal:

composer require masterro/laravel-mail-viewer

Step 2: Publish Assets & Configurations

php artisan mail-viewer:publish

Step 3: Run Migrations

php artisan migrate

Step 4: View Emails

Visit /_mail-viewer in your browser to access the email viewer.

Note: The route can be customized in the configuration file.

Configuration

You can adjust default settings in the config/mail-viewer.php file.

Data Pruning

The package supports Laravel's Model Pruning. Define how many days emails should be retained in the configuration:

'prune_older_than_days' => 365,

Production Usage

By default, the email viewer is publicly accessible. In a production environment, it's highly recommended to restrict access using middleware or something like Access Screen package. Alternatively, you can disable the package in production environments.

Restrict Access with Middleware

Modify your config/mail-viewer.php to apply authorization:

'middleware' => ['web', 'can:viewMailLogs'],

Note: viewMailLogs is just an example ability you can register via Laravel’s Authorization Gate. This ability is not included in the package.

You can also limit access by IP address in App\Http\Middleware\RestrictMailViewerAccess.php:

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;

class RestrictMailViewerAccess
{
    public function handle(Request $request, Closure $next)
    {
        if (!in_array($request->ip(), ['127.0.0.1', '::1', 'YOUR_ALLOWED_IP'])) {
            abort(403);
        }

        return $next($request);
    }
}

Apply it in config:

'middleware' => ['web', RestrictMailViewerAccess::class],

Now, only authorized users or allowed IPs can access the mail viewer.

Disable package in production mode

Disable auto-discovery:

"extra": {
  "laravel": {
    "dont-discover": [
      "masterro/laravel-mail-viewer"
    ]
  }
},

Register package for non-production environments

In your application's ServiceProvider

use MasterRO\MailViewer\Providers\MailViewerServiceProvider;

public function register(): void
{
    if (!$this->app->environment('production')) {
        $this->app->register(MailViewerServiceProvider::class);
    }
}

License

This package is open-source software licensed under the MIT license.

Credits

Developed by MasterRO.

masterro/laravel-mail-viewer 适用场景与选型建议

masterro/laravel-mail-viewer 是一款 基于 Vue 开发的 Composer 扩展包,目前已累计 105.68k 次下载、GitHub Stars 达 64, 最近一次更新时间为 2018 年 01 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「log」 「mail」 「laravel」 「mailable」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 masterro/laravel-mail-viewer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 masterro/laravel-mail-viewer 我们能提供哪些服务?
定制开发 / 二次开发

基于 masterro/laravel-mail-viewer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 105.68k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 65
  • 点击次数: 25
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 64
  • Watchers: 1
  • Forks: 12
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-16