laravel-notification-channels / todoist
此包已被弃用,不再维护。未建议替代包。
Todoist 通知驱动程序
1.0.0
2016-08-23 21:35 UTC
Requires
- php: >=5.6.4
- guzzlehttp/guzzle: ~6.0
- illuminate/notifications: 5.3.*
- illuminate/support: 5.1.*|5.2.*|5.3.*
Requires (Dev)
- mockery/mockery: ^0.9.5
- orchestra/database: 3.3.x-dev
- orchestra/testbench: 3.3.x-dev
- phpunit/phpunit: 4.*
This package is auto-updated.
Last update: 2019-10-21 23:36:04 UTC
README
此包可简化使用 Laravel 5.3 创建 Todoist 任务。
通道已弃用
请参阅 此问题 获取更多信息。
由于缺乏维护者,此通道于 2019 年 10 月弃用。
内容
安装
您可以通过 composer 安装此包
composer require laravel-notification-channels/todoist
设置 Todoist 服务
为了将票据添加到 Todoist 用户,您需要获取他们的访问令牌。
创建一个 新的 Todoist 应用 开始。
使用方法
现在您可以在通知中的 via()
方法中使用此通道
use NotificationChannels\Todoist\TodoistChannel; use NotificationChannels\Todoist\TodoistMessage; use Illuminate\Notifications\Notification; class ProjectCreated extends Notification { public function via($notifiable) { return [TodoistChannel::class]; } public function toTodoist($notifiable) { return TodoistMessage::create('This is the ticket name.') ->priority(4) ->due('tomorrow'); } }
为了让您的通知知道您针对的是哪个 Todoist 用户和列表,将 routeNotificationForTodoist
方法添加到您的可通知模型中。
此方法需要返回授权 Todoist 用户的访问令牌。
public function routeNotificationForTodoist() { return 'NotifiableAccessToken'; }
可用方法
content('')
:接受字符串值作为 Todoist 票据内容。projectId('')
:接受整数值作为 Todoist 项目 ID,默认为 "Inbox" 项目。priority('')
:接受整数值作为票据优先级。它应该是一个介于 1 和 4 之间的数字,4 表示非常紧急,1 表示自然。indent('')
:接受整数值作为票据缩进级别。它应该是一个介于 1 和 4 之间的数字,其中 1 是顶级。itemOrder('')
:接受整数值作为票据项顺序。collapsed()
:标记 Todoist 票据为折叠。due('')
:接受字符串或 DateTime 对象作为 Todoist 票据到期日期。
变更日志
请参阅 CHANGELOG 了解最近更改的信息。
测试
$ composer test
安全
如果您发现任何安全问题,请通过电子邮件 m.pociot@gmail.com 而不是使用问题跟踪器。
贡献
请参阅贡献指南以获取详细信息。
致谢
许可证
MIT许可证(MIT)。请参阅许可证文件以获取更多信息。