Download the PHP package laravel-notification-channels/microsoft-teams without Composer
On this page you can find all versions of the php package laravel-notification-channels/microsoft-teams. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravel-notification-channels/microsoft-teams
More information about laravel-notification-channels/microsoft-teams
Files in laravel-notification-channels/microsoft-teams
Package microsoft-teams
Short Description A Laravel Notification Channel for Microsoft Teams
License MIT
Homepage https://github.com/laravel-notification-channels/microsoft-teams
Informations about the package microsoft-teams
Microsoft Teams Notifications Channel for Laravel
This package makes it easy to send notifications using Microsoft Teams with Laravel 5.5+, 6.x, 7.x, 8.x, 9.x, 10.x and 11.x
Contents
- Microsoft Teams Notifications Channel for Laravel
- Contents
- Installation
- Setting up the Connector
- Setting up the MicrosoftTeams service
- Usage
- On-Demand Notification Usage
- Available Message methods
- Sections
- Changelog
- Testing
- Security
- Contributing
- Credits
- License
Installation
You can install the package via composer:
Next, if you're using Laravel without auto-discovery, add the service provider to config/app.php
:
Setting up the Connector
Please check out this 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 which goes in more detail about the do's and don'ts.
Setting up the MicrosoftTeams service
Then, configure your webhook url:
Add the following code to your config/services.php
:
You can also add multiple webhooks if you have multiple teams or channels, it's up to you.
Usage
Now you can use the channel in your via()
method inside the notification:
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.
On-Demand Notification Usage
To use on demand notifications you can use the route
method on the Notification facade.
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.options(array $options, $sectionId = null)
: Add additional options to pass to the message payload object.
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 tomy-section
.content(string $content, array $params = ['section' => 'my-section'])
: Content of the message and add it tomy-section
(Markdown supported).button(string $text, string $url = '', array $params = ['section' => 'my-section'])
: Text and url of a button and add it tomy-section
.action(string $text, $type = 'OpenUri', array $params = ['section' => 'my-section'])
: Text and type of an potential action and add it tomy-section
.
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
- Tobias Madner
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of microsoft-teams with dependencies
guzzlehttp/guzzle Version ^6.3 || ^7.0
illuminate/notifications Version ~5.5 || ~6.0 || ~7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
illuminate/support Version ~5.5 || ~6.0 || ~7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0