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

Toon Laravel Package

sbsaga/toon

View on GitHub
Deep Wiki
Context7
v1.3.0

Add v1.3.0 features: replacer API, CLI upgrades, streaming helpers, branded diagrams, and package optimization

Summary

This release prepares v1.3.0 with additive features and improved documentation while keeping backward-compatible defaults. It also fixes composer download size bloat and embeds our official logo directly into the technical diagrams.

What Changed

  • Added replacer APIs:
    • Toon::convertWith()
    • Toon::encodeWith()
    • Toon::skip()
    • toon_encode_with()
  • Added streaming helpers:
    • Toon::encodeLines()
    • Toon::decodeFromLines()
    • toon_encode_lines()
  • Enhanced toon:convert CLI with:
    • --from, --to, --stats, --delimiter, --mode, --strict
    • direction precedence and safe fallback behavior
  • Expanded and Branded Docs:
    • quickstart rewrite
    • production playbook
    • cookbook
    • troubleshooting
    • migration/faq/use-cases improvements
    • Replaced the placeholder "T" icon by embedding our official logo.webp across all 10 technical SVG diagrams in docs/assets/diagrams
  • Optimized Package Install Size:
    • Added a .gitattributes file using export-ignore rules for /docs, /assets, /tests, and related non-essential files.
    • This strictly limits end-user composer install size to just the core PHP execution code (reduces download from ~6MB to under 80 KB).

Backward Compatibility

  • Default runtime remains compatibility_mode=legacy
  • Existing APIs remain unchanged:
    • Toon::convert()
    • Toon::encode()
    • Toon::decode()
    • Toon::estimateTokens()
  • New capabilities are additive/opt-in

Verification

  • Package tests: 38 tests, 103 assertions passed
  • Functional custom testing: 22 integration tests passed seamlessly
  • .gitattributes validation: Packagist export simulated and verified (core files only included)
  • composer validate --strict passed
  • composer audit passed
  • Real Laravel smoke checks passed on:
    • Laravel 9 & 10
    • Laravel 11
    • Laravel 12
    • Laravel 13
  • Legacy CLI flags and new CLI flags both verified
v1.2.2

What's Changed

  • Added Laravel 13 support by updating the illuminate/support constraint.

Notes

This is a backward-compatible update with no breaking changes.

Thanks to @DF-DennisRehbehn for reporting the Laravel 13 compatibility issue.

v1.2.1

TOON for Laravel v1.2.1

This release improves documentation, developer experience, and package usability while preserving backward compatibility for existing users.

Highlights

  • backward-safe release for existing users
  • legacy behavior remains the default
  • new optional helper and utility methods
  • expanded docs, benchmarks, examples, and release assets
  • improved Laravel-first developer experience

Added

  • Toon::diff() for JSON vs TOON comparison
  • Toon::promptBlock() for LLM/prompt-friendly fenced TOON output
  • Toon::validate() for safe TOON validation
  • Toon::contentType() and Toon::fileExtension()
  • global helpers:
    • toon_encode()
    • toon_decode()
    • toon_diff()
    • toon_prompt()
    • toon_validate()
  • Collection::toToon() macro
  • opt-in Sbsaga\Toon\Concerns\Toonable trait

Improved

  • stronger project README and documentation structure
  • synthetic benchmark fixture and benchmark runner
  • additional usage examples for:
    • AI prompt compression
    • log payload storage
    • LLM response validation
    • HTTP TOON responses
    • Toonable model/DTO usage
  • added changelog, contributing guide, security policy, issue templates, release template, and social preview asset

Compatibility

This release is designed to be safe for users already on v1.2.0.

  • legacy compatibility mode remains the default
  • existing core APIs continue to work as before:
    • Toon::convert()
    • Toon::encode()
    • Toon::decode()
    • Toon::estimateTokens()

Verification

  • composer validate --no-check-publish
  • composer test

Result:

  • 29 tests passed
  • 75 assertions passed
v1.2.0

🚀 Overview Version 1.2.0 is a major logic update for the TOON package. This release focuses on "Lossless Data Integrity," ensuring that complex, deeply nested PHP structures can be converted to TOON and parsed back without any structural shifts or data leakage.

✨ Key Improvements

  1. Strict Indentation Guard We have introduced a new recursive scope manager in the ToonDecoder. This prevents "indentation drift" where values from a nested block could accidentally merge into the wrong parent key. The parser now strictly resets the scope based on leading spaces.

  2. Smart Object Pivoting The engine now intelligently detects when a list of objects is being parsed. If the decoder sees a repeating key (like id or order_id) at the same indentation level, it automatically pivots the parent container into a sequential array of objects.

  3. Precision Escaping Special character handling has been refined. Commas (,) and colons (:) within string values are now correctly escaped and unescaped, ensuring that names like "Sagar, Admin" or transaction IDs like "TXN:123" do not break the TOON structure.

  4. Optimized Tabular Rendering The items[N]{fields}: block logic is now more robust. It handles nested tables within associative keys much more reliably, significantly reducing token usage for AI prompts.

🛠 Internal Changes Refactored finalizeTables: Cleaner recursive cleanup of internal table markers.

Improved Type Coercion: Better handling of null, boolean, and float types during decoding.

v1.1.8

Toon 1.1.8 — Now Supports Complex Nested Arrays

Toon now fully supports more complex nested arrays, making it easier to convert deeply structured data.

  • Updated inlineScalar method to handle nested arrays recursively
  • Works with user, profile, orders, and other nested structures
  • Preserves TOON format for all existing data

What's Changed

Full Changelog: https://github.com/sbsaga/toon/compare/v1.1.7...v1.1.8

v1.1.7

What's Changed

Full Changelog: https://github.com/sbsaga/toon/compare/v1.1.6...v1.1.7

v1.1.6

What's Changed

Full Changelog: https://github.com/sbsaga/toon/compare/1.1.4...v1.1.6

v1.1.5

What's Changed

  • Update Toon Facade with PHPDoc for autocompletion by @sbsaga
  • Full TOON facade now has proper autocompletion hints for VS Code
  • Includes previous updates from #3

Full Changelog: https://github.com/sbsaga/toon/compare/v1.1.4...v1.1.5

v1.1.4

What's Changed

Full Changelog: https://github.com/sbsaga/toon/compare/v1.1.3...v1.1.4

v1.1.0
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.
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle
dmstr/api-platform-utils-bundle
dmstr/api-configuration-bundle
chrisdev/ux-components
baks-dev/finances
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle