You can install the package via composer:
composer require laravel-teams-notification/laravel-teams-notification
You can publish the config file with:
php artisan vendor:publish --tag="laravel-teams-notification-config"
This is the contents of the published config file:
return [
/*
|--------------------------------------------------------------------------
| Webhook URL
|--------------------------------------------------------------------------
|
| The webhook URL where we post a request
| You can generate test webhook URL in https://typedwebhook.tools/
| or through MS Teams Incoming WebHook
|
*/
'webhook_url' => env('WEBHOOK_URL', 'your_webhook_url'),
];
Then, you can add WEBHOOK_URL
in your .env
file. More information about how to setup webhook in MS teams in
this link.
TeamsNotification::create()
->webHookUrl('your_webhook_url')
->payload([
'type' => 'MessageCard',
'context' => 'https://schema.org/extensions',
'themeColor' => '0076D7',
'summary' => 'Hello, World',
'sections' => [
[
'activityTitle' => 'Hello, World!',
]
]
])
->dispatch();
More samples and screenshot of how the message should look can be found in screenshots
folder.
composer test
The MIT License (MIT). Please see License File for more information.