Jor*_*ola 3 php notifications laravel
我正在开发一种功能,可以通过不同的通道发送“级联”或一系列通知,它们之间有延迟。例如:
电子邮件 -> (30 分钟后) -> 推送 -> (30 分钟后) -> 短信
该流程运行良好,现在用户完成了某些操作或执行了我希望链停止的操作。所以我停止或阻止发送通知。这就是我尝试过的,但似乎没有什么能阻止他们。
我试过了:
public function via($notifiable)
{
if (whatever condition to stop) {
return null; // also tried with return []
}
return ['mail'];
}
Run Code Online (Sandbox Code Playgroud)
还
public function __construct(array $data = [])
{
if (whatever condition to stop) {
exit; // are you desperate, bruh?
}
}
Run Code Online (Sandbox Code Playgroud)
有什么我没有看到的非常明显的东西吗?可能与我们的自定义调度程序有关。您知道我可以在哪里中断应用程序以阻止发送通知吗?
事实上,这已经足够了:
public function via($notifiable)
{
if (whatever condition to stop) {
return [];
}
return ['mail'];
}
Run Code Online (Sandbox Code Playgroud)
问题是别的,Docker 向我展示了文件的缓存版本,所以它们总是返回一个return ['mail'];
| 归档时间: |
|
| 查看次数: |
2620 次 |
| 最近记录: |