notification = $notification; } /** * 执行队列任务 * * @param NotificationService $notificationService * @return void */ public function handle(NotificationService $notificationService): void { $notificationService->handleNotification($this->notification); } /** * 处理失败的任务 * * @param \Throwable $exception * @return void */ public function failed(\Throwable $exception): void { $this->notification->update([ 'status' => 'FAILED', 'message' => $exception->getMessage() ]); } }