screeningResult->update(['status' => 'processing']); try { $input = $this->screeningResult->input; $output = $screeningService->screen($input); if (is_array($output)) { unset($output['warnings']); } $this->screeningResult->update([ 'output' => $output, 'status' => 'completed', ]); } catch (\Exception $e) { \Illuminate\Support\Facades\Log::error('Screening job failed', [ 'id' => $this->screeningResult->id, 'error' => $e->getMessage() ]); $this->screeningResult->update([ 'status' => 'failed', 'output' => ['error' => $e->getMessage()], ]); } } }