PHPackages                             staffkojinpro/microsoft-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. [Mail &amp; Notifications](/categories/mail)
4. /
5. staffkojinpro/microsoft-teams

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

staffkojinpro/microsoft-teams
=============================

A Laravel Notification Channel for Microsoft Teams

v1.1.3(4y ago)09MITPHPPHP &gt;=7.2

Since Apr 28Pushed 3y agoCompare

[ Source](https://github.com/staffkojinpro/microsoft-teams)[ Packagist](https://packagist.org/packages/staffkojinpro/microsoft-teams)[ Docs](https://github.com/staffkojinpro/microsoft-teams)[ RSS](/packages/staffkojinpro-microsoft-teams/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (5)Versions (10)Used By (0)

Microsoft Teams Notifications Channel for Laravel
=================================================

[](#microsoft-teams-notifications-channel-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2981a559032fddb8bb92a93dadb01443f5e68efc39638815985b220474684c7b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f6d6963726f736f66742d7465616d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/microsoft-teams)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/f4da2c5dba84f003471d50a9bede9704597278a1b9fa1977213d39aae4871579/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f6d6963726f736f66742d7465616d732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/laravel-notification-channels/microsoft-teams)[![StyleCI](https://camo.githubusercontent.com/d7cb8db093e7c25928a809d9bd3232d92e208d8f9bc790dd5c464be4b16f066b/68747470733a2f2f7374796c6563692e696f2f7265706f732f3235383930383439382f736869656c64)](https://styleci.io/repos/258908498)[![Quality Score](https://camo.githubusercontent.com/07caefb4862e88a7b9ba70ac38a0ba8635d5cdf848192e066c0d4cba61408e0a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f6d6963726f736f66742d7465616d732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/microsoft-teams)[![Code Coverage](https://camo.githubusercontent.com/9ec199fbadfb5deb2f0101c4e0b751c193d8a59386e49aecd84e5bef95bc8497/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f6d6963726f736f66742d7465616d732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/microsoft-teams/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/bc181e74dfde3bf58f8145535ee36328be7ed99e10be28e918f03efbaf22e085/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f6d6963726f736f66742d7465616d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/microsoft-teams)

This package makes it easy to send notifications using [Microsoft Teams](https://products.office.com/en-US/microsoft-teams/group-chat-software) with Laravel 5.5+, 6.x, 7.x, 8.x, 9.x and 10.x

```
return MicrosoftTeamsMessage::create()
    ->to(config('services.microsoft_teams.sales_url'))
    ->type('success')
    ->title('Subscription Created')
    ->content('Yey, you got a **new subscription**. Maybe you want to contact him if he needs any support?')
    ->button('Check User', 'https://foo.bar/users/123');
```

Contents
--------

[](#contents)

- [Microsoft Teams Notifications Channel for Laravel](#microsoft-teams-notifications-channel-for-laravel)
    - [Contents](#contents)
    - [Installation](#installation)
        - [Setting up the Connector](#setting-up-the-connector)
        - [Setting up the MicrosoftTeams service](#setting-up-the-microsoftteams-service)
    - [Usage](#usage)
        - [On-Demand Notification Usage](#on-demand-notification-usage)
        - [Available Message methods](#available-message-methods)
            - [Sections](#sections)
    - [Changelog](#changelog)
    - [Testing](#testing)
    - [Security](#security)
    - [Contributing](#contributing)
    - [Credits](#credits)
    - [License](#license)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require laravel-notification-channels/microsoft-teams
```

Next, if you're using Laravel *without* auto-discovery, add the service provider to `config/app.php`:

```
'providers' => [
    // ...
    Staffkojinpro\MicrosoftTeams\MicrosoftTeamsServiceProvider::class,
],
```

### Setting up the Connector

[](#setting-up-the-connector)

Please check out [this](https://docs.microsoft.com/en-gb/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook#add-an-incoming-webhook-to-a-teams-channel) for setting up and adding a webhook connector to your Team's channel. Basic Markdown is supported, please also check out the [message card reference article](https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#httppost-action) which goes in more detail about the do's and don'ts.

### Setting up the MicrosoftTeams service

[](#setting-up-the-microsoftteams-service)

Then, configure your webhook url:

Add the following code to your `config/services.php`:

```
// config/services.php
...
'microsoft_teams' => [
    'webhook_url' => env('TEAMS_WEBHOOK_URL'),
],
...
```

You can also add multiple webhooks if you have multiple teams or channels, it's up to you.

```
// config/services.php
...
'microsoft_teams' => [
    'sales_url' => env('TEAMS_SALES_WEBHOOK_URL'),
    'dev_url' => env('TEAMS_DEV_WEBHOOK_URL'),
],
...
```

Usage
-----

[](#usage)

Now you can use the channel in your `via()` method inside the notification:

```
use Illuminate\Notifications\Notification;
use Staffkojinpro\MicrosoftTeams\MicrosoftTeamsChannel;
use Staffkojinpro\MicrosoftTeams\MicrosoftTeamsMessage;

class SubscriptionCreated extends Notification
{
    public function via($notifiable)
    {
        return [MicrosoftTeamsChannel::class];
    }

    public function toMicrosoftTeams($notifiable)
    {
        return MicrosoftTeamsMessage::create()
            ->to(config('services.microsoft_teams.sales_url'))
            ->type('success')
            ->title('Subscription Created')
            ->content('Yey, you got a **new subscription**. Maybe you want to contact him if he needs any support?')
            ->button('Check User', 'https://foo.bar/users/123');
    }
}
```

Instead of adding the `to($url)` method for the recipient you can also add the `routeNotificationForMicrosoftTeams` method inside your Notifiable model. This method needs to return the webhook url.

```
public function routeNotificationForMicrosoftTeams(Notification $notification)
{
    return config('services.microsoft_teams.sales_url')
}
```

### On-Demand Notification Usage

[](#on-demand-notification-usage)

To use on demand notifications you can use the `route` method on the Notification facade.

```
Notification::route(MicrosoftTeamsChannel::class,null)
    ->notify(new SubscriptionCreated());
```

### Available Message methods

[](#available-message-methods)

- `to(string $webhookUrl)`: Recipient's webhook url.
- `title(string $title)`: Title of the message.
- `summary(string $summary)`: Summary of the message.
- `type(string $type)`: Type which is used as theme color (any valid hex code or one of: primary|secondary|accent|error|info|success|warning).
- `content(string $content)`: Content of the message (Markdown supported).
- `button(string $text, string $url = '', array $params = [])`: Text and url of a button. Wrapper for an potential action.
- `action(string $text, $type = 'OpenUri', array $params = [])`: Text and type for a potential action. Further params can be added depending on the action. For more infos about different types check out [this link](https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#actions).
- `options(array $options, $sectionId = null)`: Add additional options to pass to the message payload object.

#### Sections

[](#sections)

It is possible to define one or many sections inside a message card. The following methods can be used within a section

- `addStartGroupToSection($sectionId = 'standard_section')`: Add a startGroup property which marks the start of a logical group of information.
- `activity(string $activityImage = '', string $activityTitle = '', string $activitySubtitle = '', string $activityText = '', $sectionId = 'standard_section')`: Add an activity to a section.
- `fact(string $name, string $value, $sectionId = 'standard_section')`: Add a fact to a section (Supports Markdown).
- `image(string $imageUri, string $title = '', $sectionId = 'standard_section')`: Add an image to a section.
- `heroImage(string $imageUri, string $title = '', $sectionId = 'standard_section')`: Add a hero image to a section.

Additionally the title, content, button and action can be also added to a section through the optional `params` value:

- `title(string $title, array $params = ['section' => 'my-section'])`: Title of the message and add it to `my-section`.
- `content(string $content, array $params = ['section' => 'my-section'])`: Content of the message and add it to `my-section` (Markdown supported).
- `button(string $text, string $url = '', array $params = ['section' => 'my-section'])`: Text and url of a button and add it to `my-section`.
- `action(string $text, $type = 'OpenUri', array $params = ['section' => 'my-section'])`: Text and type of an potential action and add it to `my-section`.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Tobias Madner](https://github.com/Tob0t)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~113 days

Recently: every ~175 days

Total

8

Last Release

1465d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/72d53c4becfa276cfc21d5410cf3315e5e140be04660a5343664474827564787?d=identicon)[staffkojinpro](/maintainers/staffkojinpro)

---

Top Contributors

[![Tob0t](https://avatars.githubusercontent.com/u/18067389?v=4)](https://github.com/Tob0t "Tob0t (14 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (5 commits)")[![jmurphy45](https://avatars.githubusercontent.com/u/1787262?v=4)](https://github.com/jmurphy45 "jmurphy45 (3 commits)")[![atymic](https://avatars.githubusercontent.com/u/50683531?v=4)](https://github.com/atymic "atymic (3 commits)")[![staffkojinpro](https://avatars.githubusercontent.com/u/50339268?v=4)](https://github.com/staffkojinpro "staffkojinpro (3 commits)")[![JoshuaLicense](https://avatars.githubusercontent.com/u/638172?v=4)](https://github.com/JoshuaLicense "JoshuaLicense (2 commits)")[![Cannonb4ll](https://avatars.githubusercontent.com/u/3110750?v=4)](https://github.com/Cannonb4ll "Cannonb4ll (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/staffkojinpro-microsoft-teams/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[laravel-notification-channels/expo

Expo Notifications Channel for Laravel

67628.6k1](/packages/laravel-notification-channels-expo)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)

PHPackages © 2026

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