PHPackages                             lupuscoding/webhook-teams - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. lupuscoding/webhook-teams

ActiveLibrary

lupuscoding/webhook-teams
=========================

A small library to create messages for Microsoft Teams

1.0.1(4y ago)03MITPHPPHP &gt;=7.4

Since Dec 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/LupusCoding/webhook-teams)[ Packagist](https://packagist.org/packages/lupuscoding/webhook-teams)[ Docs](http://github.com/lupuscoding/webhook-teams)[ RSS](/packages/lupuscoding-webhook-teams/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

webhook-teams - MS Teams Webhook Package
========================================

[](#webhook-teams---ms-teams-webhook-package)

A small library to create messages for Microsoft Teams.

Contents
--------

[](#contents)

- [Requirements](#requirements)
- [Install](#install)
- [Development](#development)
- [Usage](#usage)
- [Testing](#testing)

Requirements [\#](#requirements)
--------------------------------

[](#requirements-)

- PHP &gt;= 7.4

Install [\#](#install)
----------------------

[](#install-)

```
composer require lupuscoding/webhook-teams
```

Usage [\#](#usage)
------------------

[](#usage-)

### Create a message card

[](#create-a-message-card)

```
// Insert uses
use LupusCoding\Webhooks\Teams\MessageCard;
use LupusCoding\Webhooks\Teams\ThemeColor;
// Create the card
$card = new MessageCard();
$card->setThemeColor(ThemeColor::SUCCESS)
    ->setSummary('My summary');
```

### Create a message card section

[](#create-a-message-card-section)

```
use LupusCoding\Webhooks\Teams\MessageSection;
use LupusCoding\Webhooks\Teams\MessageCard;
// Create the section
$section = new MessageSection();
$section->setActivityTitle('My activity')
    ->setActivitySubtitle('This is a subtitle')
    ->setActivityImage('https://some/image.png')
    ->addFact('My fact', 'This is awesome')
    ->setMarkdown(false);
// Add section to card
$card = new MessageCard();
$card->addSection($section);
```

### Create an action card

[](#create-an-action-card)

```
// Insert uses
use LupusCoding\Webhooks\Teams\ActionCard;
use LupusCoding\Webhooks\Teams\ThemeColor;
// Create the card
$card = new ActionCard();
$card->setName('my-action-name')
    ->setThemeColor(ThemeColor::DEBUG);
```

### Create an action card input

[](#create-an-action-card-input)

```
use LupusCoding\Webhooks\Teams\ActionCard;
use LupusCoding\Webhooks\Teams\Input\TextInput;
// Create the input
$input = new TextInput();
$input->setId('input1')
    ->setTitle('Type something in')
    ->setMultiline(true)
    ;
// Add input to card
$card = new ActionCard();
$card->addInput($input);
```

### Create an action card action

[](#create-an-action-card-action)

```
use LupusCoding\Webhooks\Teams\ActionCard;
use LupusCoding\Webhooks\Teams\CardAction\HttpPost;
// Create the action
$action = new HttpPost();
$action->setName('Click me')
    ->setTarget('http://lupuscoding.de');
// Add action to card
$card = new ActionCard();
$card->addAction($action);
```

### Send a card

[](#send-a-card)

```
use LupusCoding\Webhooks\Teams\MessageCard;
$card = new MessageCard();

// Setup the hook url
$hookUrl = 'https://webhook.site/253013d5-4960-4857-85c4-596998c26e10';
// Init curl request
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_setopt($ch, CURLOPT_URL, $hookUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($card));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type:application/x-www-form-urlencoded']);
// Send request
$result = curl_exec($ch);
curl_close($ch);
// Test result
if (curl_errno($ch)) {
    // Failure
} else {
    // Success
}
```

Development [\#](#development)
------------------------------

[](#development-)

- Every contribution should respect PSR-2 and PSR-12.
- Methods must provide argument types and return types.
- Class properties must be typed.
- doc blocks must only contain descriptive information.
- doc blocks may additionally contain a type declaration for arguments or return values, if the type declaration is not precise.

For example: `func(): array` may not be precise if the method returns an array of arrays or objects. Consider a doc block entry like `@return array[]` or `@return MyObject[]` for clarification.

Testing [\#](#testing)
----------------------

[](#testing-)

First install **phpunit** by executing

```
composer install
```

Then start phpunit by executing

```
vendor/bin/phpunit
```

### Further Testing (optional)

[](#further-testing-optional)

Every test request is sent to [Pipedream](https://pipedream.com). This site processes the requests and build valid responses. Also every request is forwarded to this [Request Bin](https://requestbin.com/r/endbm4lp2m3c/22cBM6FMBVLXLFMBCoN8ZbpxOnk), so that you can view the request data.

To inspect the requests, you can login with your GitHub account and copy my published [Webhook Workflow](https://pipedream.com/@lupuscoding/lupuscoding-webhook-ms-teams-test-p_NMC1PWj). Please make sure to change the **publicBinUrl** variable inside the workflow nodejs step, to your own [Request Bin](https://requestbin.com).
After creating your Pipedream Webhook Workflow, just modify the `WEBHOOK_URL` constant inside the `MessageCardTest` and `ActionCardTest` class.\*

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

2

Last Release

1609d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9778bcba284a3c7b5ad0bee8577d852823ab8b0ef3048b54172534ab5539395?d=identicon)[LupusCoding](/maintainers/LupusCoding)

---

Top Contributors

[![LupusCoding](https://avatars.githubusercontent.com/u/25911406?v=4)](https://github.com/LupusCoding "LupusCoding (14 commits)")

---

Tags

microsoftTeams

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lupuscoding-webhook-teams/health.svg)

```
[![Health](https://phpackages.com/badges/lupuscoding-webhook-teams/health.svg)](https://phpackages.com/packages/lupuscoding-webhook-teams)
```

###  Alternatives

[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[sebbmeyer/php-microsoft-teams-connector

PHP Microsoft Teams Connector

1191.1M3](/packages/sebbmeyer-php-microsoft-teams-connector)[mpociot/teamwork

User to Team associations for the Laravel 5 Framework

1.1k663.4k1](/packages/mpociot-teamwork)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2509.6M48](/packages/thenetworg-oauth2-azure)[socialiteproviders/microsoft-azure

Microsoft Azure OAuth2 Provider for Laravel Socialite

556.0M19](/packages/socialiteproviders-microsoft-azure)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
