first())) { return null; } /** @var Collection $storedCheckResults */ $storedCheckResults = (HealthCheckResultHistoryItem::query() ->where('batch', $latestItem->batch) ->get() ->map(function (HealthCheckResultHistoryItem $item) { return new StoredCheckResult( $item->check_name, $item->check_label, $item->status, $item->notification_message, $item->short_summary === 'reachable' ? 'rconfig.com reachable' : $item->short_summary, $item->meta, $item->ended_at ); }) ); return $this->successResponse('Success', $storedCheckResults); } }