PHP code example of sliverwing / laravel-dingtalk-bot-channel
1. Go to this page and download the library: Download sliverwing/laravel-dingtalk-bot-channel library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sliverwing / laravel-dingtalk-bot-channel example snippets
# ./config/dingtalk.php
return [
'bot' => [
'token' => 'Your Token'
]
];
// ...
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return [DingtalkBotChannel::class];
}
// ...
public function toDingTalkBot($notifiable)
{
return (new Message())
->text("Test Msg")
->at(['156xxxx8827', '189xxxx8325'], false);
}
// ...