channel = config('slack.channel'); $this->icon = config('slack.icon'); $this->name = config('slack.sender_name'); $this->message = $message; } /** * Get the notification's delivery channels. * * @return array */ public function via(object $notifiable): array { return ['slack']; } /** * Get the array representation of the notification. * * @return array */ public function toArray(object $notifiable): array { return [ // ]; } /** * Get the Slack representation of the notification. * @param mixed $notifiable * @return SlackMessage */ public function toSlack(object $notifiable): SlackMessage { return (new SlackMessage) ->text($this->message); } /** * 各通知チャンネルで使用するキューを判断。 * * @return array */ public function viaQueues(): array { return [ 'slack' => QueueName::JOB->value, ]; } }