As described in this issue there is a problem when using slack webhook handler and returning null dynamically in routeNotificationForSlack() i. e. if a slack webhook url can be configured on a user-level.
Illuminate\Notifications\Channels\SlackWebhookChannel::buildJsonPayload(): Argument #1 ($message) must be of type Illuminate\Notifications\Messages\SlackMessage, Illuminate\Notifications\Slack\SlackMessage given, called in vendor/laravel/slack-notification-channel/src/Channels/SlackWebhookChannel.php on line 43.
Returning a URL like https://hooks.slack.com/ would work, but would still send a post request to the given URL.
This PR allows returning false in routeNotificationForSlack() and would then stop the send process.
As described in this issue there is a problem when using slack webhook handler and returning
null
dynamically inrouteNotificationForSlack()
i. e. if a slack webhook url can be configured on a user-level.When returning
null
the application assumesSlackWebApiChannel
should be used instead ofSlackWebhookChannel
which then leads to an error:Returning a URL like https://hooks.slack.com/ would work, but would still send a post request to the given URL.
This PR allows returning
false
inrouteNotificationForSlack()
and would then stop the send process.