cirelramos/simple-notification

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

1.0.1 2023-01-04 02:59 UTC

This package is not auto-updated.

Last update: 2024-09-26 09:29:48 UTC


README

Software License

关于

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

如何创建 composer 包的教程

安装

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

composer require cirelramos/simple-notification

配置

设置提供者

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

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

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

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

用法

如果未指定警告()或错误()方法,则默认通知设置为日志类型。

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

通知级别的用法

如果未指定警告()或错误()方法,则默认通知设置为日志类型。

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

许可协议

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