定制 l12-fox/laravel-notification-log 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

l12-fox/laravel-notification-log

最新稳定版本:v3.0.2

Composer 安装命令:

composer require l12-fox/laravel-notification-log

包简介

Logs every sent Notification and Mail of your entire Project.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Logs every sent Notification and Mail of your entire Laravel Project.

Installation

You can install the package via composer:

composer require teamnovu/laravel-notification-log

You can publish and run the migrations with:

php artisan vendor:publish --tag="notification-log-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="notification-log-config"

The following config file will be published in config/notification-log.php:

return [

    /*
    |--------------------------------------------------------------------------
    | Compress Messages
    |--------------------------------------------------------------------------
    |
    | In case you send a lot of E-Mails the message_sent_logs table could become
    | very big. With this option you can enable that the body of every log
    | entry will be compressed with gzip to reduce its size.
    |
    */

    'compress-messages' => env('NOTIFICATION_LOG_COMPRESS_MESSAGES', false),
    
    /*
    |--------------------------------------------------------------------------
    | Resolve Notification Message
    |--------------------------------------------------------------------------
    |
    | If this is enabled, the Logger will try to resolve the built message
    | out of the notification. This is useful if you want to debug your
    | sent notifications.
    |
    */

    'resolve-notification-message' => env('NOTIFICATION_LOG_RESOLVE_NOTIFICATION_MESSAGE', false),
];

Usage

Add the following Interface and Trait to your Notification:

use Teamnovu\LaravelNotificationLog\Concerns\LogNotification;
use Teamnovu\LaravelNotificationLog\Contracts\ShouldLogNotification;

class DummyNotification extends Notification implements ShouldLogNotification
{
    use LogNotification;

    // ...
    
}

Now send a Notification or Mail as you would normally do. The package will automatically log the Notification or Mail.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

[//]: # (## Contributing)

[//]: # () [//]: # (Please see [CONTRIBUTING](CONTRIBUTING.md) for details.)

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-24