Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Util Transformer Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Documentation / Flatten Decoder

Introduction

The FlattenDecoder expands array with flattened keys to nested array.

Using the decoder

// Convert to anything

$decoder = new FlattenDecoder('_');
$flattened = [
    'a1_b1_c1' => 111,
    'a1_b1_c2' => 112,
    'a2' => 2,
];
$decoder->canTransform($flattened); // -> bool
$result = $decoder->transform($flattened); // -> mixed output

/*
$result => [
    'a1' => [
        'b1' => [
            'c1' => 111,
            'c2' => 112,
        ],
    ],
    'a2' => 2,
];
*/
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
cadot.eu/make
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky