Pipeline Workflow
Pipeline Workflow
sequenceDiagram
participant App as Laravel app
participant Pii as Pii facade
participant Engine as RedactorEngine
participant Detector as Detectors and NER
participant Strategy as Strategy
App->>Pii: redact(text)
Pii->>Engine: redact(text, optional strategy)
Engine->>Detector: detect(text)
Detector-->>Engine: Detection[]
Engine->>Engine: resolve overlaps
Engine->>Strategy: apply(value, detector)
Strategy-->>Engine: replacement
Engine-->>App: redacted text
- Register detectors
The service provider registers configured international detectors, country-pack detectors, and custom YAML detectors. - Collect detections
Each detector returns immutableDetectionvalues. - Resolve overlap
The earliest span wins, with longer match winning on equal offset. - Replace right-to-left
Later spans are replaced first so earlier offsets remain valid. - Emit audit event
If enabled and at least one match occurred, counts are dispatched without raw PII.