Microsoft Teams Laravel Notification Channel

composer require laravel-notification-channels/microsoft-teams
// config/app.php
'providers' => [
// ...
NotificationChannels\MicrosoftTeams\MicrosoftTeamsServiceProvider::class,
],
// config/services.php
...
'teams' => [
'webhook_url' => env('TEAMS_WEBHOOK_URL'),
],
...
// config/services.php
...
'teams' => [
'main_url' => env('TEAMS_MAIN_WEBHOOK_URL'),
'test_url' => env('TEAMS_TEST_WEBHOOK_URL'),
],
...

Usage

use Illuminate\Notifications\Notification;
use NotificationChannels\MicrosoftTeams\MicrosoftTeamsChannel;
use NotificationChannels\MicrosoftTeams\MicrosoftTeamsMessage;

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

public function toMicrosoftTeams($notifiable)
{
return MicrosoftTeamsMessage::create()
->to(config('services.teams.webhook_url'))
->type('success')
->title('Order Processed')
->content('You order has been processed successfully.')
->button('Check User', 'https://xyz.abc/users/123');
}
}

Full stack developer and Tech enthusiast, experienced with PHP, MySQL, Laravel and VueJS. Love reading and writing 😊

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

What you do you think is best?

Launching a VPC with Public & Private subnet & NAT Gateway in AWS using Terraform!

Dockerized Services in Azure K8s

IoT Platforms: Additional Evaluation Criteria

Marinade’s sponsored prize for the Solana Riptide Hackathon 2022

Using the New Enigma Python SDK

Hlo, everyone…

IDamageable Interface in Unity- Game Dev Series 106

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Bakary Diarra

Bakary Diarra

Full stack developer and Tech enthusiast, experienced with PHP, MySQL, Laravel and VueJS. Love reading and writing 😊

More from Medium

Install Redis for Laravel Valet with PHP 8.1

Building Web Applications Using Laravel

Add Aiven database magic to your Laravel project

How to make Laravel app can interact with user by email using Webhook