Closed JackWH closed 2 years ago
Hey Jack, yes it does conflict/replace the first-party package. I appreciate the feedback because I was going back and forth on this design initially, and figured that people would likely want to use only one slack notifications package.
However given your use case, it would make sense to allow both packages to run side by side.
The via
extension is an easy change. The first party Laravel package also uses the toSlack
method to generate a notification array, so this package will need to use a different method.
Overall I think this is a valid suggestion. I'll make updates today and get v0.3.0 out.
This will be resolved in #19
You will need to add the following to your .env
:
SLACK_API_DRIVER_NAME=slackBot
Your notification class should also implement Nwilging\LaravelSlackBot\Contracts\Notifications\SlackApiNotificationContract
and use the toSlackArray
method to return the message array needed for this package, to avoid conflicts with laravel/slack-notification-channel
's toSlack()
method.
@nwilging That's brilliant, thank you! 👍
I see this package binds to
slack
as the notification channel name — but so does Laravel's default Slack notification channel: https://github.com/laravel/slack-notification-channel/blob/2.0/src/SlackChannelServiceProvider.phpMy app uses Laravel's basic Slack notifications to send internal messages to our team, but I'd also like to use this API-based package for more advanced notifications elsewhere in the app.
Can these two be run alongside each other without conflicting? If not, would it be worth renaming this package's channel to something like
slackBot
or similar?Thanks!