【问题标题】:laravel slack message not sendinglaravel 松弛消息未发送
【发布时间】:2018-09-12 09:13:33
【问题描述】:

我遵循了一些关于如何通过 Laravel 发送 Slack 消息的教程。 公共函数 routeNotificationForSlack($notification) 从未被调用,但我不知道为什么。

我的通知句柄如下所示,待办事项是通过以 ->get() 类结尾的雄辩查询检索到的:NotifyTodo :

foreach($todos as $todo) {

    $reminder = new RemindTodo($todo);

    $reminder->toSlack($reminder);
}

我的 toSlack 函数类:RemindTodo:

public function toSlack($notifiable)
{
    $todo = $this->todo;

    return (new SlackMessage)
        ->success()
        ->content($todo['description']);
}

还有我的 :Todo: 模型,其中包含使用 Notifiable;和 routeNotificationForSlack 方法:

public function routeNotificationForSlack($notification)
{
    dd('test');
    return env('SLACK_WEBHOOK_URL');
}

【问题讨论】:

    标签: laravel notifications slack


    【解决方案1】:

    如果您使用 .env,请尝试清除缓存,如下所示:

    php artisan cache:clear
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多