承接 vikramsra/email-log-to-db 相关项目开发

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

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

vikramsra/email-log-to-db

最新稳定版本:1.0.1

Composer 安装命令:

composer require vikramsra/email-log-to-db

包简介

A plugin to log emails to the database in Laravel.

README 文档

README

A Laravel plugin to log email information to a database table and provide a user interface for viewing, filtering, and managing email logs. This plugin is intended to help developers keep track of emails sent through their application.

Features

  • Log emails sent from your Laravel application.
  • View email logs in a Bootstrap-based table.
  • Filter logs by recipient, subject, or sent date.
  • Real-time filtering using AJAX.
  • View detailed information in a modal pop-up.
  • Easily override the default views without publishing.

Installation

Step 1: Install the Package

Clone or install this package into your plugins directory. Alternatively, you can add it to your composer.json as a local package:

composer require vikramsra/email-log-to-db

Step 2: Add Service Provider

Add the EmailLogServiceProvider to your bootstrap/providers.php file or in your composer.json to automatically register the provider:

Register in bootstrap/providers.php

'providers' => [
    // Other service providers...
    Vikramsra\EmailLogToDb\EmailLogServiceProvider::class,
],

Step 3: Run Migrations

This package includes a migration to create the email_logs table. Run the migration using:

php artisan migrate

Usage

Step 1: Log Emails

The package will automatically log emails sent from your Laravel application. No further configuration is needed.

Step 2: View Email Logs

You can access the email logs in your Laravel application by visiting /email-logs.

The logs are presented in a user-friendly table with the following features:

  • Real-Time Search: Filter by recipient or subject in real-time.
  • Date Filter: Filter by sent date.
  • View Details: Click on the "View Details" button to see the full email body and attachments in a modal pop-up.

Step 3: Overriding Views

If you need to customize the views, simply create corresponding Blade files in your main Laravel application at resources/views/vendor/emailLogs/.

For example:

  • To override the email log listing page, create resources/views/vendor/emailLogs/index.blade.php.
  • To override the details modal, create resources/views/vendor/emailLogs/show.blade.php.

Laravel will automatically prioritize these views over the package-provided ones.

Available Routes

  • GET /email-logs: View and filter the list of email logs.
  • GET /email-logs/{id}: View details for a specific email log.

Customization

Overriding the Default Views

The package provides a default UI to manage the email logs. If you want to modify the views to fit your application's style, you can override them without publishing:

  • Create Blade files in resources/views/vendor/emailLogs/ to override the default views.
  • The default views will be used if no overriding views are found.

Requirements

  • Laravel 11+.
  • PHP 8.2 or newer.

Contributing

If you would like to contribute, please open a pull request or an issue in the repository. Contributions are always welcome!

License

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

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-18