$value * @return array */ public function transform(DataProperty $property, mixed $value, TransformationContext $context): mixed { return $value->map(fn ($field) => [ ...$field->toArray(), 'type' => class_basename($field), ])->toArray(); } }