laravel-notification-channels / workplace
Workplace 通知通道
0.0.1
2020-01-01 00:25 UTC
Requires
- php: >=7.0
- guzzlehttp/guzzle: ^6.3
- illuminate/notifications: ~5.5 || ~6.0
- illuminate/support: ~5.5 || ~6.0
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: 8.*
This package is auto-updated.
Last update: 2024-09-18 16:00:00 UTC
README
此包使您能够通过 Laravel 5.5+ 和 6.0 使用 Workplace 发送通知。
内容
安装
您可以通过 composer 安装此包。
composer require laravel-notification-channels/workplace
使用
您现在可以在通知类内部的 via()
方法中使用此通道。
use NotificationChannels\Workplace\WorkplaceChannel; use NotificationChannels\Workplace\WorkplaceMessage; use Illuminate\Notifications\Notification; class WorkplaceNotification extends Notification { public function via($notifiable) { return [WorkplaceChannel::class]; } public function toWorkplace($notifiable) { return new WorkplaceMessage('# Laravel Notification Channels are awesome!'); } }
您还需要在可通知的模型中添加 routeNotificationForWorkplace()
方法。
class TestNotifiable { use \Illuminate\Notifications\Notifiable; public function routeNotificationForWorkplace() { return 'https://graph.facebook.com/<groupId>/feed?access_token=<access_token>'; } }
可用消息方法
content('')
: (字符串) 通知消息,支持 Markdown。asMarkdown()
: 将消息内容视为 Markdown(默认)asPlainText()
: 将消息内容视为纯文本
更新日志
有关最近更改的更多信息,请参阅更新日志。
测试
$ composer test
安全
如果您发现任何安全相关的问题,请通过电子邮件 mail@goncaloqueiros.net 联系,而不是使用问题跟踪器。
贡献
有关详细信息,请参阅贡献。
致谢
许可
MIT 许可证 (MIT)。有关更多信息,请参阅许可文件。