LaravelPackages.net
Acme Inc.
Toggle sidebar
laravel-teams-notification/laravel-teams-notification

A Laravel package that integrates Microsoft Teams notification.

9
1
v1.0.2
About laravel-teams-notification/laravel-teams-notification

laravel-teams-notification/laravel-teams-notification is a Laravel package for a laravel package that integrates microsoft teams notification.. It currently has 1 GitHub stars and 9 downloads on Packagist (latest version v1.0.2). Install it with composer require laravel-teams-notification/laravel-teams-notification. Discover more Laravel packages by laravel-teams-notification or browse all Laravel packages to compare alternatives.

Last updated

A simple Laravel package that integrates Microsoft Teams webhook.

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Installation

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.

Usage

TeamsNotification::create()
    ->webHookUrl('your_webhook_url')
    ->payload([
        'type' => 'MessageCard',
        'context' => 'https://schema.org/extensions',
        'themeColor' => '0076D7',
        'summary' => 'Hello, World',
        'sections' => [
            [
                'activityTitle' => 'Hello, World!',
            ]
        ]
    ])
    ->dispatch();

Screenshot

More samples and screenshot of how the message should look can be found in screenshots folder.

Testing

composer test

Credits

License

The MIT License (MIT). Please see License File for more information.

Comments