All notable changes to this project will be documented in this file.
- Laravel 13 support
- Full TOON v3.0 specification compliance
- Global helper functions:
toon_encode()andtoon_decode() - Spec-compliant string quoting (strings with special characters are now quoted with
"...") - Proper escape sequences within quoted strings (
\n,\r,\t,\",\\) - Delimiter support: comma (default), tab (
\t), and pipe (|) viadelimiterconfig option - Strict mode for decoding with validation errors via
strictconfig option - Key folding: collapse single-key nested objects into dot notation via
key_foldingconfig - Path expansion: expand dotted keys back to nested objects via
expand_pathsconfig - Official specification test fixtures from toon-format/spec
- Inline primitive array format (
key[N]: a,b,c)
- BREAKING: String escaping now uses quoted strings instead of backslash escaping
- Before:
message: Hello\, World\: Test - After:
message: "Hello, World: Test"
- Before:
- BREAKING: Removed
escape_styleconfig option (no longer applicable) - Float encoding now preserves full IEEE 754 double precision (16 significant digits)
The decoder maintains backward compatibility and parses both old backslash-escaped format and new quoted strings.
If you have code that expects the old output format:
- Encoded output now uses quoted strings for special characters
- Republish config:
php artisan vendor:publish --tag=toon-config --force - Set
strict => falseif parsing legacy TOON with formatting issues
toToon()collection macro for direct Collection-to-TOON conversion (thanks @jimmypuckett)
- Laravel Collections are now properly converted to arrays before encoding, preventing JSON fallback output
- Other
ArrayableandTraversableobjects are also handled correctly
- Unified
omitconfig array to skip values:['null', 'empty', 'false']or['all'] omit_keysconfig array to always skip specific keyskey_aliasesconfig for shortening key names (saves tokens)date_formatconfig for formatting DateTime objects and ISO date stringstruncate_stringsconfig to limit string length with ellipsisnumber_precisionconfig to limit decimal places for floatsToon::diff($data)method to calculate token savings between JSON and TOONToon::only($data, $keys)method to encode only specific keys
- Replaced
omit_null_valuesboolean with flexibleomitarray (breaking change)
omit_null_valuesconfig option (use'omit' => ['null']instead)
- Initial release
- TOON encoding with tabular array format
- TOON decoding with nested object reconstruction
- Type preservation (int, float, bool, null)
- Special character escaping (comma, colon, newline)
- Configurable table thresholds
- Laravel 9, 10, 11, and 12 support
- PHP 8.2+ support