# 发布配置
php artisan vendor:publish --provider="Kriss\Notification\Integrations\Laravel\NotificationServiceProvider"修改 config/php-notification.php 中的相关配置
// 使用 Facade
\PhpNotification::channel('weWorkBot')->sendText('test');
// 使用单例
\Kriss\Notification\Integrations\Laravel\Notification::instance()->channel('weWorkBot')->sendText('test');新建类如下:
<?php
namespace App\Components;
use Kriss\Notification\Channels;
/**
* @method static Channels\WeWorkBotChannel weWorkBot()
* @method static Channels\WeWorkAppChannel weWorkApp()
* @method static Channels\MailerChannel mailer()
*/
class Notification extends \Kriss\Notification\Integrations\Laravel\Notification
{
}使用
use App\Components\Notification;
Notification::weWorkBot()->sendText('test');