duanpai9945 2018-11-13 07:32
浏览 19

如果删除模型记录,则中止可排队的通知

I can't seem to find a solution for this. I have a Laravel Notification that uses the Queueable trait. So, the scenario is like this: a user posts a new record, a notification is normally queued to be sent to all other users available. But then, that user, wishes to cancel/delete the newly added record.

Deleting the already sent out notifications is easy, but how do I delete the notifications that are still in queue?

Will InteractsWithQueue help with this concern? If so, I'm not sure how to utilize it though. Do I create a different Job to do the cleanup?

Thanks.

UPDATE:

BTW, I am using the database queue and SoftDeletes trait for this. And said notification is dispatched right after the record is created.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?
    • ¥15 matlab(相关搜索:紧聚焦)