There is no doubt that Microsoft Teams is one of the best communication platform in business and technology industries.
Having your Laravel Application sending notification to such a platform can be a huge plus for you and your business.
In this tutorial, you will learn how to install and configure Laravel Notification Channel’s Microsoft Teams package.
Install the package via composer:
composer require laravel-notification-channels/microsoft-teams
Next, if you are using auto-discovery than you can skip this step, otherwise you must register the package in
'providers' => [
After, you will need to set up the connector ( Check this article to have more info on setting up and adding a webhook connector to your Team’s channel).
'teams' => [
'webhook_url' => env('TEAMS_WEBHOOK_URL'),
Adding more than one webhook is also possible, like described below.
'teams' => [
'main_url' => env('TEAMS_MAIN_WEBHOOK_URL'),
'test_url' => env('TEAMS_TEST_WEBHOOK_URL'),
The usage is fairly simple, you can use the channel in your
via() method inside the notification class.
class OrderProcessed extends Notification
public function via($notifiable)
public function toMicrosoftTeams($notifiable)
->content('You order has been processed successfully.')
->button('Check User', 'https://xyz.abc/users/123');
Instead of adding the
to($url)method for the recipient you can also add the
routeNotificationForMicrosoftTeamsmethod inside your Notifiable model. This method needs to return the webhook URL.