Use this page when TOON output or decode behavior is not what you expected.
Check mode first:
// config/toon.php
'compatibility_mode' => 'legacy',
Then verify:
pipe or tab)Likely causes:
Fix:
Toon::validate($toon, true) before decode in import flowsTOON benefits most from repeated field structures. Small or irregular payloads can have minor savings.
Measure:
$report = \Sbsaga\Toon\Facades\Toon::diff($payload);
Add a replacer and centralize policy:
Toon::encodeWith($payload, function (array $path, string|int|null $key, mixed $value) {
return in_array($key, ['password', 'token', 'secret'], true)
? Toon::skip()
: $value;
});
Direction precedence:
--decode / --encode--from / --to.json => encode, .toon => decode)Use explicit options when uncertain:
php artisan toon:convert storage/app/data.input --from=json --to=toon
Safe approach:
legacymodernUse:
Toon::encodeLines() for iteration-friendly outputToon::decodeFromLines() to rebuild dataWhen reporting an issue, include:
compatibility_mode, delimiter, and strict_modeHow can I help you explore Laravel packages today?