【发布时间】:2019-09-25 19:54:32
【问题描述】:
使用可排队通知时:
class MyNotification extends Notification implements ShouldQueue
{
use Queueable;
}
如何处理失败的作业?如果我通过作业类发送电子邮件/通知,我可以使用 failed 方法:
public function failed(Exception $exception) {
Log::debug('MyNotification failed');
}
但是通知中的失败方法不起作用
【问题讨论】:
-
失败的方法适用于通知...
-
那么上面放在 MyNotification 类中的 failed() 方法应该可以工作吗?它没有为我记录错误。是否需要导入其他类来触发 failed() 方法。
标签: php laravel laravel-queue laravel-notification