litermi/simple-notification

Simple Notification 是一个在出现错误时发送通知的包

1.0.20 2024-05-08 18:36 UTC

README

Software License

关于

Simple Notification 是一个在出现错误时发送通知的包。

如何创建 composer 包的教程

安装

在您的 composer.json 中要求 litermi/simple-notification 包并更新您的依赖项

composer require litermi/simple-notification

配置

设置提供者

'providers' => [
    // ...
    Litermi\SimpleNotification\Providers\ServiceProvider::class,
],

默认设置在 config/simple-notification.php 中。发布配置以将文件复制到您自己的配置

php artisan vendor:publish --provider="Litermi\SimpleNotification\Providers\ServiceProvider"

注意:这是必要的,以便您可以更改默认配置

使用方法

如果没有指定 warning() 或 error() 方法,默认通知设置为日志类型。

$extraValues['test'] = 1;
SimpleNotificationFacade::email()->slack()->notification('message notification', $extraValues);

通知级别的使用

如果没有指定 warning() 或 error() 方法,默认通知设置为日志类型。

$extraValues['test'] = 1;
SimpleNotificationFacade::email()->slack()->warning()->notification('message notification', $extraValues);
SimpleNotificationFacade::email()->slack()->error()->notification('message notification', $extraValues);

许可证

在 MIT 许可证下发布,请参阅 LICENSE