Oh and if I hardcode the webhook_url in routeNotificationForSlack() everything works as expected
Dynamic Slack webhook and/or Storing Slack webhook URL per user or team
Hi All,
I've been smashing my head against the wall for a while on this.
At first I was trying to access to Auth:user() object from the routeNotificationForSlack() which in hindsight, makes sense why this wouldn't work from a queue.
After some googling and playing around I found this post https://laracasts.com/discuss/channels/laravel/sending-notification-to-multiple-slack-webhooks# but this is still relying on known configuration settings, which I just won't have.
I tried to change it to pass the webhook url itself as below;
public $webhook;
public function routeNotificationForSlack() {
if($this->webhook){
return $this->webhook;
}
}
public function slackWebhook($teamhook){
$this->webhook = $teamhook;
return $this;
}
This runs, but the webhook url doesnt appear to be available, nor does the slack message arrive.
To be clear, this notification will be used by multiple users/teams in my system, each of which will have their own webhook url.
Any help would be greatly appreciated
Chris
Please or to participate in this conversation.