toon:convert supports both legacy usage and newer explicit direction/options.
php artisan toon:convert {file?} [options]The command resolves encode/decode direction in this order:
--decodeor--encode(highest priority)--fromand--to- file extension autodetect (
.json-> encode,.toon-> decode) - fallback to decode (legacy-compatible default)
--from=auto|json|toon--to=auto|json|toon--stats(writes metrics JSON to STDERR)--delimiter=comma|pipe|tab|<char>--mode=legacy|modern--strict(strict table validation when decoding)
Encode JSON file to TOON:
php artisan toon:convert storage/app/payload.json --encodeDecode TOON to pretty JSON:
php artisan toon:convert storage/app/payload.toon --decode --prettyUse explicit direction without encode/decode flags:
php artisan toon:convert storage/app/payload.data --from=json --to=toonOverride mode and delimiter for one command only:
php artisan toon:convert storage/app/payload.json --encode --mode=modern --delimiter=pipeWrite stats to STDERR while keeping payload on STDOUT:
php artisan toon:convert storage/app/payload.json --encode --stats- Existing scripts using only
--encodeor--decoderemain valid. - No default behavior changes were introduced for direction fallback.
- Runtime config overrides via CLI are command-local and do not require editing
config/toon.php.
