PHP code example of lumintech / laravel-feishu-robot

1. Go to this page and download the library: Download lumintech/laravel-feishu-robot 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/ */

    

lumintech / laravel-feishu-robot example snippets


use LuminTech\LaravelFeishuRobot\FeishuRobotCardMessage;

$cardMessage = app()->make(FeishuRobotCardMessage::class);
$cardMessage->setHeaderTemplate(FeishuRobotCardMessage::TEMPLATE_WARING);
$cardMessage->setSubTitle('页面缓存监控');
$cardMessage->addText('-> 告警类型:http监控告警');
$cardMessage->addText('-> 告警时间:2023-01-01 00:00:00');
$cardMessage->addText('-> 告警内容:http://www.baidu.com');
$cardMessage->addAtAllText('蚂蚁足球-监控告警提醒,请尽快处理 ');
$response = $cardMessage->send();

FeishuRobotCardMessage::setHeaderTemplate(string $template): FeishuRobotCardMessage
FeishuRobotCardMessage::setTitle(string $title): FeishuRobotCardMessage 
FeishuRobotCardMessage::setSubTitle(string $subTitle): FeishuRobotCardMessage
FeishuRobotCardMessage::addText(string $text): FeishuRobotCardMessage   
FeishuRobotCardMessage::addAtText(string $text): FeishuRobotCardMessage 
FeishuRobotCardMessage::addAtAllText(string $text): FeishuRobotCardMessage
FeishuRobotCardMessage::send()