Download the PHP package beyondcode/slack-notification-channel without Composer
On this page you can find all versions of the php package beyondcode/slack-notification-channel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download beyondcode/slack-notification-channel
More information about beyondcode/slack-notification-channel
Files in beyondcode/slack-notification-channel
Package slack-notification-channel
Short Description Slack Notification Channel for Laravel using API tokens.
License MIT
Informations about the package slack-notification-channel
Laravel Slack API Token Notification Channel
This is the Laravel Slack notification channel, but instead of using incoming webhooks, this channel makes use of OAuth access tokens. It also allows replies to thread messages.
If you want to learn how to create reusable PHP packages yourself, take a look at my upcoming PHP Package Development video course.
Usage
Install the package via composer:
The service provider gets registered automatically and you can use this package as a replacement of the core Laravel Slack notification channel.
Notification Routing
Since this notification channel makes use of Slack API tokens instead of incoming webhook URLs, you need to return an array containing the API token and an optional channel.
This channel will be used, if it is not provided in the SlackMessage
that you send:
Replying to Message Threads
Assuming you want to keep track of orders and have your team/bot respond to a single thread of per order placed, this channel allows you to retrieve the API response from the chat.postMessage method inside your notifications. With this you could post messages on order paid, shipped, closed, etc. events to the same thread.
In your order placed event you can have
And in your order paid event you can have
Customizing the channel name
Laravel ships with a slack notification channel which uses web hooks. This packages overwrites that default slack channel.
Should you want to use Laravel's default Slack channel and this one inside one app, you'll need to use a different channel name.
You can set the channel name using
Make sure you use the right method name on your notifications.
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Marcel Pociot
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of slack-notification-channel with dependencies
guzzlehttp/guzzle Version ^6.0|^7.0
illuminate/notifications Version ^6.0|^7.0|^8.0|^9.0|^10.0