phrity/util-transformer
Lightweight PHP utility for transforming values between types. Provides transformers with canTransform()/transform(), plus resolvers to chain and recurse converters. Includes JSON/flatten decoders and converters for basic types, DateTime, enums, Stringable, Throwable and more.
RecursionResolver + JsonDecoder for nested JSON parsing).FirstMatchResolver.StringResolver for debug output).BasicTypeConverter for consistent serialization).ReversedReadable to convert strings like "true" to booleans).Adopt if:
FlattenDecoder + JsonDecoder for nested JSON parsing).NormalizerInterface) and you want to integrate them seamlessly.Look elsewhere if:
msgpack or igbinary).moneyphp/money).spatie/array-to-object or league/flysystem).For Executives: *"This package lets us standardize data transformations across our Laravel stack—reducing bugs in APIs, logs, and caching while cutting dev time. For example:
StringResolver).For Engineers: *"This gives us building blocks for data pipelines without reinventing wheels:
RecursionResolver + JsonDecoder) for nested data.DateTime → string, Enum → string) with explicit canTransform() checks.PropertyNormalizer) via the SymfonyNormalizerWrapper.
Tradeoff: Early-stage package (0 stars), but the code is clean, documented, and PHP 8.1+ compatible. Let’s prototype a high-priority use case (e.g., API response normalization) to validate."*How can I help you explore Laravel packages today?