PHPackages                             talvbansal/laravel-ms-teams-notification-channel - 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. talvbansal/laravel-ms-teams-notification-channel

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

talvbansal/laravel-ms-teams-notification-channel
================================================

Basic MS Teams Notifications Channel for Laravel

1.2.0(3y ago)2126.0k↓33.3%2[1 PRs](https://github.com/talvbansal/laravel-ms-teams-notification-channel/pulls)MITPHPPHP ^7.2 || ^8.0

Since Nov 12Pushed 3y ago2 watchersCompare

[ Source](https://github.com/talvbansal/laravel-ms-teams-notification-channel)[ Packagist](https://packagist.org/packages/talvbansal/laravel-ms-teams-notification-channel)[ Docs](https://github.com/talvbansal/laravel-ms-teams-notification-channel)[ Fund](https://paypal.me/talvbansal)[ GitHub Sponsors](https://github.com/talvbansal)[ RSS](/packages/talvbansal-laravel-ms-teams-notification-channel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (7)Versions (8)Used By (0)

MS Teams Notifications Channel for Laravel
==========================================

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/f1cd7b306d206c6cf2d6281ad0ec67bcf89886ea29652fa1c005382803e3d5f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74616c7662616e73616c2f6c61726176656c2d6d732d7465616d732d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/talvbansal/laravel-ms-teams-notification-channel)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/ab8fc194e551a70f40ceab2b96c666c495d1a076798120c201ae0f6da1bc94f8/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f74616c7662616e73616c2f6c61726176656c2d6d732d7465616d732d6e6f74696669636174696f6e2d6368616e6e656c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/talvbansal/laravel-ms-teams-notification-channel)[![StyleCI](https://camo.githubusercontent.com/f71384d272a68a1cb3389458a4bbe249856afb0e5321bac7e7c085379b1efbfa/68747470733a2f2f7374796c6563692e696f2f7265706f732f3232313235363033392f736869656c64)](https://styleci.io/repos/221256039)[![SensioLabsInsight](https://camo.githubusercontent.com/7a395d7551140767a9f38f838e0e96b367bae56234402374185cd65ee8d795a1/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f3a73656e73696f5f6c6162735f69642e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/:sensio_labs_id)[![Quality Score](https://camo.githubusercontent.com/ab48720aebb204cf1219141820cf50c7b9ab71dc06e2f0eab5b141142369e658/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f74616c7662616e73616c2f6c61726176656c2d6d732d7465616d732d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/talvbansal/laravel-ms-teams-notification-channel)[![Code Coverage](https://camo.githubusercontent.com/793d57e593dce6a346c1ef672a93514e624c02e3e2aa5187f9faf4b2f1e51fe8/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f74616c7662616e73616c2f6c61726176656c2d6d732d7465616d732d6e6f74696669636174696f6e2d6368616e6e656c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/talvbansal/laravel-ms-teams-notification-channel/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/75cf54d1a4280ecd62a030fee0824e51d093cc22f25ccb8ed5704a631fce5e94/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74616c7662616e73616c2f6c61726176656c2d6d732d7465616d732d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/talvbansal/laravel-ms-teams-notification-channel)

This package makes it easy to send notifications using [MS Teams](https://docs.microsoft.com/en-gb/microsoftteams/platform/task-modules-and-cards/cards/cards-reference#office-365-connector-card) with Laravel 5.5+ - 8.0.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Setting up the Connector](#setting-up-the-connector)
- [Usage](#usage)
- [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require talvbansal/laravel-ms-teams-notification-channel
```

### Setting up the Connector

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

Please refer to [this article](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 MS Team's channel.

Then, configure your webhook url:

```
// config/services.php
...
'ms-teams' => [
    'webhook_url' => env('MS_TEAMS_WEBHOOK_URL', 'WEBHOOK URL HERE')
],
...
```

You can change this to be whatever you like so if you have multiple teams you want to send notifications to you could do the following:

```
// config/services.php
...
'ms-teams' => [
    'developers_webhook_url' => env('MS_TEAMS_DEVELOPERS_WEBHOOK_URL'),
    'helpdesk_webhook_url' => env('MS_TEAMS_HELPDESK_WEBHOOK_URL'),
],
...
```

As long as you remember to route the notifications to the correct team.

Usage
-----

[](#usage)

You can now use the channel in your via() method inside the Notification class.

### Notifications

[](#notifications)

```
use NotificationChannels\MsTeams\MsTeamsChannel;
use NotificationChannels\MsTeams\MsTeamsMessage;
use Illuminate\Notifications\Notification;

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

    public function toMsTeams($notifiable)
    {
        $url = url('/invoice/' . $this->invoice->id);

        return MsTeamsMessage::create()
            // Optional recipient user id.
            ->to(config('services.ms-teams.webhook_url'))
            // Markdown supported.
            ->content("Hello there!\nYour invoice has been *PAID*")
            // (Optional) Inline Buttons
            ->button('View Invoice', $url)
            ->button('Download Invoice', $url)
            // (Optional) Supporting images
            ->image('https://source.unsplash.com/random/800x800?animals,nature&q='.now())
            ->image('https://source.unsplash.com/random/900x600?building,car&q='.now());
    }
}
```

### Routing the message

[](#routing-the-message)

You can either send the notification by providing with the webhook url to the recipient to the to($url) method like shown in the above example or add a routeNotificationForMsTeams() method in your notifiable model:

```
...
/**
 * Route notifications for the MS Teams channel.
 *
 * @return int
 */
public function routeNotificationForMsTeams()
{
    return config('services.ms-teams.webhook_url');
}
...
```

### Available Message methods

[](#available-message-methods)

- `to($webhookUrl): (string)` Recipient's chat id.
- `title(''): (string)` Notification title, does not support markdown.
- `content(''): (string)` Notification message, supports markdown..
- `button($text, $url): (string)` Adds an inline "Call to Action" button. You can add as many as you want.
- `image($url): (string)` Adds an inline image from the given url. You can add as many as you want.
- `code($code): (string)` Adds a code fragment to the message. You can add as many as you want.
- `type($type): (string)` Change the accent of the card sent. You can choose between 'info', 'warning', 'error', 'success'

More examples and information about this package can be found [here.](https://www.talvbansal.me/blog/send-notifications-to-ms-teams-with-laravel/)

Throttling notifications
========================

[](#throttling-notifications)

If you find you're receiving too many of a given notification you can use [this package](https://github.com/talvbansal/laravel-throttled-failed-jobs) to help limit the number of notifications you get during a period where something has gone wrong.

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 :author\_email instead of using the issue tracker.

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Talv Bansal](https://github.com/talvbansal)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Please see [this repo](https://github.com/laravel-notification-channels/channels) for instructions on how to submit a channel proposal.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 94.4% 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 ~186 days

Recently: every ~230 days

Total

6

Last Release

1439d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.2

1.2.0PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c829c7a19b9512381047a8b028a97e8b1a8ed57423005a48d899ae138203ea1?d=identicon)[talvbansal](/maintainers/talvbansal)

---

Top Contributors

[![talvbansal](https://avatars.githubusercontent.com/u/7305131?v=4)](https://github.com/talvbansal "talvbansal (17 commits)")[![szabizs](https://avatars.githubusercontent.com/u/5064872?v=4)](https://github.com/szabizs "szabizs (1 commits)")

---

Tags

hacktoberfestlaravelnotificationms teamsms teams notificationms teams notifications channel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/talvbansal-laravel-ms-teams-notification-channel/health.svg)

```
[![Health](https://phpackages.com/badges/talvbansal-laravel-ms-teams-notification-channel/health.svg)](https://phpackages.com/packages/talvbansal-laravel-ms-teams-notification-channel)
```

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[gr8shivam/laravel-sms-api

A modern, flexible Laravel package for integrating any SMS gateway with REST API support

10138.4k](/packages/gr8shivam-laravel-sms-api)[laravel-notification-channels/africastalking

This package makes it easy to send notifications via AfricasTalking with Laravel

2529.1k](/packages/laravel-notification-channels-africastalking)

PHPackages © 2026

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