Skip to content

Choose stable Pulsar identifiers

Use a per-Domain backed Enum for a closed owned machine vocabulary, configuration for open or environment-varying values, and Laravel strings where Laravel requires them. Keep a mutable human label separate from every persisted or protocol identifier.

Stable identifiers: classify the boundary before naming it

CategoryOwner and representationChange rule and prohibited shape
Business state/categoryOwning Domain, closed; per-Domain backed Enum.Persist the machine value; label changes independently. No god Enum or free string.
AbilityOwning Domain, closed; backed Enum value at the Gate API.Keep the machine name stable; no cross-Domain registry or hard-coded call-site string.
Event name/category/versionOwning Domain, closed; Enum when useful and VERSION on the Event.Protocol value/version is immutable by default; no casual rename.
Queue name/connectionApplication operations, open or environment-varying; Laravel configuration.Configuration can vary by environment; no Enum pretending it is closed.
Command signatureThe Command's framework-required string.Treat CLI name as compatibility-sensitive; no duplicate global Enum.
Route nameThe route's framework-required namespaced string.Treat external links as compatibility-sensitive; no registry replacing Laravel APIs.
Idempotency keySide-effect boundary or input-defined immutable value.Reuse it for the same effect; storage and retention are application-owned.
Persisted, protocol, or external IDRecord/protocol owner; immutable scalar, Value Object, constant, or closed Enum.Map or migrate deliberately; never use a mutable display label.

Magic strings

OrderAbility::Refund->value is a conversion at Laravel's string API, not a reason to spread strings through a Domain. A human label() may change without changing the backed machine value. Where Laravel owns the API, keep its command signature and route-name strings at that boundary instead of introducing a registry.

An idempotency key remains the same through retries for one intended side effect. That is not an exactly-once promise and does not choose storage, retention, a migration, or an external-ID service.

Preserve compatibility deliberately

Persisted, protocol, and external values can have consumers outside a single code deploy. Treat a rename as an application compatibility decision. This page supplies no schema, registry, migration policy, or global ID service.

See Authorization for ability enforcement, Events for Event guarantees, and Architecture decisions for the canonical source heading.