sebbmeyer/laravel-teams-connector
Composer 安装命令:
composer require sebbmeyer/laravel-teams-connector
包简介
Microsoft Teams Connector for Laravel 5/6
README 文档
README
A Laravel 5/6 package to send notifications to Microsoft Teams by using "Incoming Webhook". This package also contains a card to send a Laravel Forge deployment notification, because Microsoft Teams notification is not supported at the moment.
If you are using Laravel 5.4 or older versions of laravel, please use the version 0.3.x of this package.
Package Installation - Composer
You can install the package via composer:
composer require sebbmeyer/laravel-teams-connector
Laravel
If you are using Laravel 5.5 and up, the service provider will automatically get registered.
For older versions of Laravel (<5.5), you have to add the service provider and alias to config/app.php:
Sebbmyr\LaravelTeams\TeamsConnectorServiceProvider::class,
You can optionally use the facade for shorter code. Add this to your facades:
'TeamsConnector' => Sebbmyr\LaravelTeams\Facades\TeamsConnector::class,
Lumen
For Lumen usage, the service provider should be registered manually by adding the following line in bootstrap/app.php:
$app->register(Sebbmyr\LaravelTeams\TeamsConnectorServiceProvider::class);
Configuration
For this package to work, you need to configure an "Incomming Webhook" connector in your targeted Teams channel and copy the url into a config file that you can publish like this:
php artisan vendor:publish --provider="Sebbmyr\LaravelTeams\TeamsConnectorServiceProvider"
... or you simple add the following to your .env file:
MICROSOFT_TEAMS_WEBHOOK=<incoming_webhook_url>
Usage
How to send simple notification look at the readme of this package sebbmeyer/php-microsoft-teams-connector
Custom card - ForgeCard
You can create your own cards for every purpose you need, just extend the AbstractCard class and implement the getMessage() function.
\\ Sebbmyr\LaravelTeams\Cards\ForgeCard.php public function getMessage() { return [ "@type" => "MessageCard", "@context" => "http://schema.org/extensions", "summary" => "Forge Card", "themeColor" => ($this->data["status"] === 'success') ? self::STATUS_SUCCESS : self::STATUS_ERROR, "title" => "Forge deployment message", "sections" => [ [ "activityTitle" => "", "activitySubtitle" => "", "activityImage" => "", "facts" => [ [ "name" => "Server:", "value" => $this->data["server"]['name'] ], [ "name" => "Site", "value" => "[". $this->data["site"]["name"] ."](http://". $this->data["site"]["name"] .")" ], [ "name" => "Commit hash:", "value" => "[". $this->data["commit_hash"] ."](". $this->data["commit_url"] .")" ], [ "name" => "Commit message", "value" => $this->data["commit_message"] ] ], "text" => ($this->data["status"] === 'success') ? $this->data["commit_author"] ." deployed some fresh code!" : "Something went wrong :/" ] ] ]; }
Custom Card
You can use the CustomCard class and dynamically build out our card. Based on Microsoft Legacy Card
Available Methods
- addTitle
- addText
- addColor
- addActivity
- addFacts
- addFactsText
- addImage
- addImages
- addAction
$card = New Sebbmyr\LaravelTeams\Cards\CustomCard('Title Test','Text Test'); $card->addColor('800080') ->addFactsText('Supported Laravel Versions',['5.x','6.x']) ->addFactsText('Unsupported Laravel Versions',['Before Version 5']) ->addAction('Laravel Website','http://www.laravel.com') ->addFacts('Facts Section',['Fact Name 1' => 'Fact Value 1','Fact Name 2' => 'Fact Value 2']); app('TeamsConnector')->send($card);
Adaptive Card
To use an adaptive card see the documentation here. Better support will coming soon.
License
This Microsoft Teams connector for Laravel is open-sourced software licensed under the MIT license
sebbmeyer/laravel-teams-connector 适用场景与选型建议
sebbmeyer/laravel-teams-connector 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 166.09k 次下载、GitHub Stars 达 33, 最近一次更新时间为 2018 年 08 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「microsoft」 「connectors」 「connector」 「Teams」 「messagecard」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sebbmeyer/laravel-teams-connector 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sebbmeyer/laravel-teams-connector 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sebbmeyer/laravel-teams-connector 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Microsoft Teams Connector
A simple PHP package for sending messages to Microsoft Teams
API wrapper for Securibox Cloud Agents.
Laravel 5 Queue Driver for Microsoft Azure Storage Queue
Laravel package for the simplification and integration of many of your users most wanted login providers. Installation is a breeze. Never worry about OAuth again.
Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps
统计信息
- 总下载量: 166.09k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 33
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-10