定制 spatie/laravel-notification-log 二次开发

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

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

spatie/laravel-notification-log

最新稳定版本:1.3.3

Composer 安装命令:

composer require spatie/laravel-notification-log

包简介

Log notifications sent by your Laravel app

README 文档

README

Logo for laravel-notification-log

Log notifications sent by your Laravel app

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

This package will log all the notifications sent by your app. This will allow you to write logic based on the notifications your app has sent.

If you want to create a list of all notifications sent to a user

// returns a collection of `NotificationLogItem` models
$sentNotifications = $user->loggedNotifications();

In a view, you could write this:

<ul>
@foreach($sentNotifications as $sentNotification)
    <li>{{ $sentNotification->type }} at {{ $sentNotification->created_at->format('Y-m-d H:i:s') }}</li>
@endforeach
</ul>

The package also contains handy methods that allow you to make decisions based on the notifications sent. Here's an example, where we use the wasAlreadySentTo method provided by the package in a shouldSent method of a notification.

// in a notification

public function shouldSend($notifiable)
{
      return ! $this
        ->wasAlreadySentTo($notifiable)
        ->inThePastMinutes(60);
}

You can fully customize which notifications get logged and how they get logged.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Documentation

All documentation is available on our documentation site.

Testing

composer test

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

统计信息

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

GitHub 信息

  • Stars: 202
  • Watchers: 2
  • Forks: 21
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-24