Facade and service methods:
Toon::convert(mixed $input): stringToon::convertWith(mixed $input, ?callable $replacer = null): stringToon::encode(mixed $input): stringToon::encodeWith(mixed $input, ?callable $replacer = null): stringToon::decode(string $toon): arrayToon::encodeLines(mixed $input): \GeneratorToon::decodeFromLines(iterable $lines): arrayToon::skip(): objectToon::estimateTokens(string $toon): arrayToon::diff(mixed $input): arrayToon::promptBlock(mixed $input, string $fenceLabel = 'toon'): stringToon::validate(string $toon, bool $strict = true): arrayToon::contentType(): stringToon::fileExtension(): stringReplacer callback contract:
fn(array $path, string|int|null $key, mixed $value): mixedToon::skip() to remove fields/itemsGlobal helpers:
toon_encode(mixed $data): stringtoon_encode_with(mixed $data, callable $replacer): stringtoon_encode_lines(mixed $data): arraytoon_decode(string $toon): arraytoon_diff(mixed $data): arraytoon_prompt(mixed $data, string $label = 'toon'): stringtoon_validate(string $toon, bool $strict = true): arrayCollection macro:
collect($rows)->toToon(): stringOpt-in trait:
Sbsaga\Toon\Concerns\Toonableenabledescape_styledelimitermin_rows_to_tabularmax_preview_itemscoerce_scalar_typesstrict_modecompatibility_modelegacy when protecting existing serialized output contractsmodern for new projects that want cleaner nested-data round tripsApply these manually in the repository metadata for discoverability:
laravellaravel-packagelaravel-aitoonlaravel-toonllmprompt-compressiontoken-optimizationstructured-dataopenaiHow can I help you explore Laravel packages today?