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 / Json Decoder

Introduction

The JsonDecoder decodes JSON string and return decoded data.

Using the decoder

// Convert to anything

$decoder = new JsonDecoder();
$decoder->canTransform($json); // -> bool
$decoder->transform($json); // -> mixed output

// Objects decoded as object or associative arrays

$json = '{"int": 1234, "bool": true, "null": null}';
$decoder1 = new JsonDecoder();
$decoder1->transform($json); // -> object output
$decoder2 = new JsonDecoder(true);
$decoder2->transform($json); // -> array output

// Converting to specific type only allowed if decoded value has matching type

$json = '{"int": 1234, "bool": true, "null": null}';
$decoder->canTransform($json, Type::OBJECT); // -> true
$decoder->canTransform($json, Type::STRING); // -> false
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