Skip to content

Attributes

Carapace uses PHP attributes to provide powerful functionality with minimal boilerplate. This section covers the available attributes and how to use them.

  • CastWith - Cast values during hydration
  • MapFrom - Map properties from custom input keys
  • MapTo - Control output keys during serialization
  • Hidden - Exclude properties from serialization