Skip to main content

Serialization, Property Serializers

What is Serialization?

Serialization is the process of converting data represented by Data class objects into standard data types: strings, numbers, arrays.

Scalar values are serialized as they are, while objects are checked for the presence of the toArray() method.

Arrays, unless decorated with the Set attribute, will be passed unchanged.

You can create your own serializer for any property by implementing the Looqey\Speca\Contracts\Transformer interface.

Creating and Using a Property Serializer

To create and use your own property serializer, implement the Transformer