PHP Classes

How to use a Laravel TOON service class to encode and decode values in a more efficient way than using JSON using the package Laravel Toon: Encode and decode values in the TOON format

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2025-11-16 (22 days ago) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
laraveltoon 1.0BSD License8Web services, Data types, PHP 8
Description 

Authors

Alberto Rial Barreiro
Jacobo Cantorna Cigarrán


Contributor

This package can encode and decode values in the TOON format.

It provides a Laravel service class that can take a variable value and encode it as a string in the Token-Optimized Object Notation.

The service class can also decode a string in the TOON format, as well provide other services.

Currently, it can:

- Perform an analysis to compare encoded values in TOON and JSON formats

- Estimate the cost of sending requests to OpenAI GPT API using TOON and JSON formats

- Provide an adapter to send requests to OpenAI GPT API using the TOON format to send and retrieve responses

Innovation Award
PHP Programming Innovation award nominee
November 2025
Nominee
Vote
Token-Optimized Object Notation (TOON) is a text format that can be used to store and retrieve variable values in a string.

It is similar to JSON but it is more efficient in terms of the number of characters that it uses to encode values.

This package provides an encoding and decoding TOON format service for Laravel applications.

Manuel Lemos
Picture of Jacobo Cantorna Cigarrán
  Performance   Level  
Name: Jacobo Cantorna Cigarrán <contact>
Classes: 3 packages by
Country: Spain Spain
Age: 45
All time rank: Not yet ranked
Week rank: Not yet ranked
Innovation award
Innovation award
Nominee: 2x

Instructions

Please read this document to learn how to encode and decode data in the TOON format.

Documentation

Usage Examples - LaravelToon

Table of Contents

  1. Basic Compression
  2. Token Analysis
  3. LLM Integration
  4. Cost Calculation
  5. Eloquent Models
  6. Compression Middleware
  7. Real-World Cases

Basic Compression

Example 1: Convert JSON to TOON

use Squareetlabs\LaravelToon\Facades\Toon;

$userData = [
    'id' => 1,
    'name' => 'John Garcia',
    'email' => 'john@example.com',
    'roles' => ['admin', 'user', 'moderator'],
    'profile' => [
        'bio' => 'Laravel Developer',
        'country' => 'USA',
        'verified' => true,
    ],
];

// Readable format (recommended)
$toonReadable = Toon::encode($userData);
// user: John Garcia
// id: 1
// email: john@example.com
// roles[3]: admin,user,moderator
// profile:
//   bio: Laravel Developer
//   country: USA
//   verified: true

// Compact format (maximum compression)
$toonCompact = Toon::encodeCompact($userData);

// Tabular format (for uniform arrays)
$toonTabular = Toon::encodeTabular($userData);

Example 2: Decode TOON

$toon = <<<TOON
id: 1
name: John Garcia
email: john@example.com
TOON;

$decoded = Toon::decode($toon);
// Returns:
// ['id' => 1, 'name' => 'John Garcia', 'email' => 'john@example.com']

Example 3: Configuration Files

// Use helpers for more concise code
$data = [...];

$readable = toon_readable($data);  // Readable
$compact = toon_compact($data);    // Compact
$tabular = toon_tabular($data);    // Tabular
$decoded = toon_decode($toon);     // Decode

Token Analysis

Example 1: Estimate Tokens

use Squareetlabs\LaravelToon\Services\TokenAnalyzer;

$analyzer = app(TokenAnalyzer::class);

$content = "This is a long content with many words...";

// Estimate tokens in content
$tokens = $analyzer->estimate($content);
// 125

// Detailed analysis
$analysis = $analyzer->analyze($content);
// [
//     'length_chars' => 312,
//     'length_words' => 45,
//     'tokens_estimated' => 125,
//     'chars_per_token' => 2.5,
// ]

Example 2: Compare JSON vs TOON

$data = [
    'users' => [
        ['id' => 1, 'name' => 'John'],
        ['id' => 2, 'name' => 'Maria'],
        ['id' => 3, 'name' => 'Carlos'],
    ],
];

$comparison = $analyzer->compareJsonVsToon($data);
// [
//     'json_tokens' => 245,
//     'toon_tokens' => 98,
//     'tokens_saved' => 147,
//     'percent_saved' => 60.0,
//     'efficiency_ratio' => 0.4,
// ]

Example 3: Token Budget

// Does it fit in 10,000 tokens?
$budget = $analyzer->budgetTokens(10000, $largeDataset);

if ($budget['within_budget']) {
    // Process
} else {
    echo "You need ".$budget['tokens_used']." tokens";
    echo "Available: ".$budget['tokens_available'];
}

LLM Integration

Example 1: OpenAI

use Squareetlabs\LaravelToon\Adapters\OpenAIAdapter;

$openai = new OpenAIAdapter();

if (!$openai->isEnabled()) {
    throw new Exception('OpenAI is not configured');
}

// Send compressed message
$response = $openai->sendMessage(
    'Analyze this dataset: '.json_encode($largeData),
    'gpt-4o',
    ['temperature' => 0.7, 'max_tokens' => 2000]
);

if ($response['success']) {
    echo "Tokens saved: ".$response['original_message_tokens'] 
         - $response['compressed_message_tokens'];
}

Example 2: Claude/Anthropic

use Squareetlabs\LaravelToon\Adapters\AnthropicAdapter;

$claude = new AnthropicAdapter();

// Multi-turn compressed chat
$messages = [
    ['role' => 'user', 'content' => 'First question with lots of context...'],
    ['role' => 'assistant', 'content' => 'First response...'],
    ['role' => 'user', 'content' => 'Second question...'],
];

$response = $claude->chat(
    $messages,
    'claude-3-sonnet-20240229'
);

echo "Compressed messages: ".$response['messages_count'];
echo "Tokens saved: ".$response['tokens_saved'];

Example 3: Google Gemini

use Squareetlabs\LaravelToon\Adapters\GeminiAdapter;

$gemini = new GeminiAdapter();

$response = $gemini->sendMessage(
    'Process this JSON: '.json_encode($data),
    'gemini-pro'
);

// Gemini automatically receives compressed format

Cost Calculation

Example 1: Estimate Single Request Cost

use Squareetlabs\LaravelToon\Services\CostCalculator;

$calculator = app(CostCalculator::class);

$dataset = [...]; // Large data

// Estimate cost for GPT-4o
$cost = $calculator->estimateCost('gpt-4o', $dataset, 'input');

echo "Tokens: ".$cost['tokens'];
echo "Cost: ".$cost['cost_formatted'];  // $0.0625

// Output:
// [
//     'model' => 'gpt-4o',
//     'tokens' => 2500,
//     'cost_per_million' => 0.0025,
//     'cost' => 0.00625,
//     'cost_formatted' => '$0.0063',
// ]

Example 2: Compare Prices Across Models

$comparison = $calculator->compareModels($dataset, 'input');

// Returns models sorted by cost (lowest to highest)
// [
//     'gpt-3.5-turbo' => ['cost' => 0.001],
//     'claude-3-haiku' => ['cost' => 0.0006],
//     'gemini-pro' => ['cost' => 0.0003],
//     'gpt-4o' => ['cost' => 0.00625],
// ]

echo "Cheapest model: ".$comparison['cheapest'];
echo "Most expensive: ".$comparison['most_expensive'];

Example 3: JSON vs TOON - Cost Savings

// Compare cost using JSON vs TOON
$jsonVsToon = $calculator->estimateWithJsonComparison(
    'gpt-4o',
    $largeDataset,
    'input'
);

// [
//     'json' => ['tokens' => 5000, 'cost' => 0.0125],
//     'toon' => ['tokens' => 1500, 'cost' => 0.00375],
//     'savings' => ['tokens' => 3500, 'cost' => 0.00875, 'percent' => 70.0],
// ]

echo "You save: ".$jsonVsToon['savings']['cost_formatted'];

Example 4: Budget Analysis

// How many requests can I make with $100?
$budget = $calculator->budgetAnalysis(
    'gpt-4o',
    100,        // $100 budget
    $dataset,
    'input'
);

// [
//     'budget' => 100.0,
//     'cost_per_request' => 0.00625,
//     'requests_affordable' => 16000,
//     'percent_budget_per_request' => 0.00625,
// ]

echo "I can make ".$budget['requests_affordable']." requests";

Eloquent Models

Example 1: Serialize Model to TOON

use Squareetlabs\LaravelToon\Traits\HasToonEncoding;

class User extends Model
{
    use HasToonEncoding;
}

$user = User::with('posts', 'comments')->first();

// Convert to TOON
$toon = $user->toToon('readable');

// Compact format
$compact = $user->toToonCompact();

// Get metrics
$metrics = $user->getToonMetrics();
echo "Compression ratio: ".$metrics['compression_ratio'];

Example 2: Send Model to LLM API

use Squareetlabs\LaravelToon\Adapters\OpenAIAdapter;

$user = User::find(1);
$openai = new OpenAIAdapter();

// Send compressed model
$response = $openai->sendMessage(
    "Analyze this user: ".$user->toToonCompact(),
    'gpt-4o'
);

Compression Middleware

Example 1: Configure Middleware

In app/Http/Kernel.php:

protected $middleware = [
    // ...
];

protected $routeMiddleware = [
    // ...
    'compress' => \Squareetlabs\LaravelToon\Middleware\CompressResponse::class,
];

Example 2: Use in Routes

Route::get('/api/data', function () {
    return User::all();
})->middleware('compress');

Example 3: Configuration in .env

# In config/laravel-toon.php
LARAVEL_TOON_AUTO_COMPRESS=true
LARAVEL_TOON_MIN_RESPONSE_SIZE=1024
LARAVEL_TOON_COMPRESSION_THRESHOLD=50  # Minimum % to activate

Real-World Cases

Example 1: AI Recommendation System

class RecommendationController extends Controller
{
    public function getRecommendations(Request $request)
    {
        $user = auth()->user();
        $userHistory = $user->purchaseHistory()->limit(100)->get();
        $similarUsers = $this->findSimilarUsers($user);
        
        // Compress data
        $contextData = toon_compact([
            'user' => $user->toArray(),
            'history' => $userHistory->toArray(),
            'similar_users' => $similarUsers->toArray(),
        ]);
        
        // Estimate cost
        $cost = toon_cost_estimate('gpt-4o', $contextData);
        
        if ($cost['cost'] > 0.01) {
            // Reduce context
            $contextData = toon_compact([
                'user_summary' => $user->only(['id', 'name', 'preferences']),
                'recent_purchases' => $userHistory->take(20)->toArray(),
            ]);
        }
        
        // Use adapter
        $ai = new OpenAIAdapter();
        $recommendations = $ai->sendMessage(
            "Based on this user: $contextData, recommend 5 products",
            'gpt-4o'
        );
        
        return $recommendations;
    }
}

Example 2: Log Analysis with AI

class LogAnalyzerController extends Controller
{
    public function analyzeLogs(Request $request)
    {
        $logs = Log::whereBetween('created_at', [
            now()->subDays(7),
            now()
        ])->get();
        
        // Group and compress
        $logsCompressed = toon_compact([
            'errors' => $logs->where('level', 'error')->groupBy('message'),
            'warnings' => $logs->where('level', 'warning')->count(),
            'stats' => [
                'total' => $logs->count(),
                'timespan' => '7 days',
            ],
        ]);
        
        // Analyze with Claude (better for long analysis)
        $claude = new AnthropicAdapter();
        $analysis = $claude->sendMessage(
            "Analyze these logs: $logsCompressed\n\nProvide insights and recommendations",
            'claude-3-sonnet-20240229'
        );
        
        return [
            'original_size' => strlen(json_encode($logs)),
            'compressed_size' => strlen($logsCompressed),
            'analysis' => $analysis,
            'cost_saved' => toon_cost_with_json_comparison(
                'claude-3-sonnet-20240229',
                $logs->toArray()
            ),
        ];
    }
}

Example 3: RAG (Retrieval-Augmented Generation)

class RAGController extends Controller
{
    public function query(Request $request)
    {
        $query = $request->input('query');
        
        // Search relevant documents
        $documents = Document::search($query)->take(20)->get();
        
        // Compress context
        $context = toon_compact(
            $documents->map(fn($doc) => [
                'title' => $doc->title,
                'content' => substr($doc->content, 0, 500),
                'relevance' => $doc->relevance_score,
            ])->toArray()
        );
        
        // Check if fits in budget
        $budget = toon_budget_analysis(
            'gpt-4o',
            0.50,  // $0.50 budget
            ['context' => $context, 'query' => $query]
        );
        
        if (!$budget['within_budget']) {
            // Reduce number of documents
            $documents = $documents->take(5);
            $context = toon_compact($documents->toArray());
        }
        
        // Generate response
        $openai = new OpenAIAdapter();
        $answer = $openai->sendMessage(
            "Based on this context: $context\n\nAnswer: $query",
            'gpt-4o'
        );
        
        return $answer;
    }
}

Example 4: Benchmark and Optimization

class OptimizationController extends Controller
{
    public function benchmark(Request $request)
    {
        $data = $request->input('data');
        
        $metrics = app(\Squareetlabs\LaravelToon\Services\CompressionMetrics::class)
            ->full($data);
        
        return [
            'summary' => [
                'json_size' => $metrics['compression']['json_size_bytes'],
                'toon_size' => $metrics['compression']['toon_size_bytes'],
                'reduction_percent' => $metrics['compression']['percent_reduced'],
            ],
            'tokens' => [
                'json' => $metrics['tokens']['json_tokens'],
                'toon' => $metrics['tokens']['toon_tokens'],
                'saved' => $metrics['tokens']['tokens_saved'],
                'saved_percent' => $metrics['tokens']['percent_saved'],
            ],
            'recommendations' => $metrics['recommendations'],
            'formats' => [
                'json' => $metrics['content']['original_json'],
                'toon' => $metrics['content']['compressed_toon'],
            ],
        ];
    }
}

These are complete examples! For more help, check: - README - Installation - CHANGELOG - ---

LaravelToon v1.0.0 - November 14, 2025


Details

LaravelToon

Token-Optimized Object Notation for Laravel Compress your AI prompts, reduce API costs, and optimize LLM contexts seamlessly.

<p align="center"> <a href="https://scrutinizer-ci.com/g/squareetlabs/LaravelToon/"><img src="https://scrutinizer-ci.com/g/squareetlabs/LaravelToon/badges/quality-score.png?b=main" alt="Quality Score"></a> <a href="https://scrutinizer-ci.com/g/squareetlabs/LaravelToon/"><img src="https://scrutinizer-ci.com/g/squareetlabs/LaravelToon/badges/build.png?b=main" alt="Build Status"></a> <a href="https://scrutinizer-ci.com/g/squareetlabs/LaravelToon/"><img src="https://scrutinizer-ci.com/g/squareetlabs/LaravelToon/badges/code-intelligence.svg?b=main" alt="Code Intelligence"></a> <a href="https://packagist.org/packages/squareetlabs/laravel-toon"><img class="latest_stable_version_img" src="https://poser.pugx.org/squareetlabs/laravel-toon/v/stable" alt="Latest Stable Version"></a> <a href="https://packagist.org/packages/squareetlabs/laravel-toon"><img class="license_img" src="https://poser.pugx.org/squareetlabs/laravel-toon/license" alt="License"></a> </p>

Overview

LaravelToon is a native Laravel package that integrates TOON (Token-Oriented Object Notation) a compact and readable format designed to optimize token usage in LLM contexts.

Why LaravelToon

  • Cost Savings: Reduces tokens by 60-70%, saving money on APIs
  • Native Integration: Service providers, Facades, Artisan commands ready to use
  • Multi-LLM: Supports OpenAI, Claude, Gemini, Mistral with ready-made adapters
  • Deep Analysis: Token analysis, compression metrics, cost estimation
  • High Performance: Integrated benchmarking and caching optimizations
  • Interactive Dashboard: CLI tool to explore and experiment

Quick Start

Installation

composer require squareetlabs/laravel-toon

Configuration (Optional)

php artisan vendor:publish --provider="Squareetlabs\LaravelToon\LaravelToonServiceProvider" --tag=laravel-toon-config

Basic Usage

use Squareetlabs\LaravelToon\Facades\Toon;

// Convert to TOON
$data = [
    'user' => 'John',
    'email' => 'john@example.com',
    'roles' => ['admin', 'user']
];

$toon = Toon::encode($data);
echo $toon;
// user: John
// email: john@example.com
// roles[2]: admin,user

// Or use helpers
echo toon_readable($data);      // Readable format
echo toon_compact($data);       // Compact format
echo toon_tabular($data);       // Tabular format

Documentation

Full Guides

Main Features

1. Compression and Conversion

// Complete compression analysis
$metrics = Toon::getMetrics($data);
echo "Bytes saved: " . $metrics['bytes_saved'] . "\n";
echo "Tokens saved: " . $metrics['tokens_saved'] . "\n";
echo "Ratio: " . $metrics['compression_ratio'] . "\n";

// Compare with JSON
$comparison = Toon::compareWithJson($data);

2. Token Analysis

use Squareetlabs\LaravelToon\Services\TokenAnalyzer;

$analyzer = app(TokenAnalyzer::class);

// Estimate tokens
$tokens = $analyzer->estimate($content);
$comparison = $analyzer->compareJsonVsToon($data);

// Token budget
$budget = $analyzer->budgetTokens(10000, $data);
// ['max_tokens' => 10000, 'tokens_used' => 2500, 'within_budget' => true]

3. API Cost Calculation

use Squareetlabs\LaravelToon\Services\CostCalculator;

$calculator = app(CostCalculator::class);

// Estimate cost for GPT-4o
$cost = $calculator->estimateCost('gpt-4o', $data, 'input');
// ['tokens' => 2500, 'cost' => 0.0625, 'cost_formatted' => '$0.0625']

// Compare JSON vs TOON cost
$comparison = $calculator->estimateWithJsonComparison('gpt-4o', $data);

// Compare prices across models
$models = $calculator->compareModels($data);

4. LLM API Adapters

use Squareetlabs\LaravelToon\Adapters\OpenAIAdapter;

$openai = new OpenAIAdapter();

// Send compressed message to OpenAI
$response = $openai->sendMessage(
    'Analyze this compressed JSON...',
    'gpt-4o',
    ['temperature' => 0.7]
);

// Chat with compressed messages
$messages = [
    ['role' => 'user', 'content' => 'First message'],
    ['role' => 'assistant', 'content' => 'Response'],
];

$chatResponse = $openai->chat($messages, 'gpt-4o');

Artisan Commands

toon:convert

Converts JSON files to TOON or vice versa.

# JSON to TOON
php artisan toon:convert data.json --format=readable

# TOON to JSON (decode)
php artisan toon:convert data.toon --decode --pretty

# Save to file
php artisan toon:convert data.json --output=compressed.toon

toon:analyze

Analyzes compression and efficiency.

php artisan toon:analyze data.json --verbose

Shows: - JSON vs TOON size - Estimated tokens - Reduction percentage - Recommendations

toon:benchmark

Runs performance and cost estimation benchmarks.

php artisan toon:benchmark data.json --iterations=100 --model=gpt-4o

Shows: - Encoding/decoding time - Size comparison - Cost estimation

toon:dashboard

Interactive dashboard to explore LaravelToon.

php artisan toon:dashboard

Allows: - Convert JSON TOON - Analyze compression - Estimate costs - View model prices

? Available Helpers

// Encoding
toon($data)                          // Readable format
toon_compact($data)                  // Compact format
toon_readable($data)                 // Readable format
toon_tabular($data)                  // Tabular format
toon_convert($data, 'compact')       // With specified format

// Decoding
toon_decode($toon)                   // TOON to PHP

// Compression and Metrics
toon_compress($data)                 // Full compression
toon_metrics($data)                  // Detailed metrics
toon_compression_summary($data)      // Summary

// Tokens
toon_estimate_tokens($content)       // Estimate tokens
toon_compare_json_vs_toon($data)     // Compare JSON vs TOON
toon_analyze($content)               // Detailed analysis

// Benchmark
toon_benchmark($data, 100)           // Performance benchmark

// Costs
toon_cost_estimate('gpt-4o', $data)          // Estimate cost
toon_cost_compare_models($data)              // Compare models
toon_cost_with_json_comparison('gpt-4o', $data) // With JSON comparison
toon_budget_analysis('gpt-4o', 100, $data)  // Budget analysis

Integration with Eloquent Models

use Squareetlabs\LaravelToon\Traits\HasToonEncoding;

class User extends Model
{
    use HasToonEncoding;
}

$user = User::first();

// Convert to TOON
echo $user->toToon();                    // Readable format
echo $user->toToonCompact();             // Compact format

// Get metrics
$metrics = $user->getToonMetrics();
$ratio = $user->getToonCompressionRatio();

Validation

use Squareetlabs\LaravelToon\Rules\ValidToonFormat;

$request->validate([
    'compressed_data' => [new ValidToonFormat()],
]);

Advanced Configuration

The config/laravel-toon.php file allows you to configure:

return [
    // Encoding options
    'encoding' => [
        'indent' => 2,
        'delimiter' => ',',
        'min_rows_to_tabular' => 2,
    ],

    // Token analysis
    'token_analysis' => [
        'enabled' => true,
        'estimate_method' => 'character_ratio',
        'cache_results' => true,
    ],

    // LLM model prices
    'cost_calculation' => [
        'models' => [
            'gpt-4o' => ['input' => 0.0025, 'output' => 0.010],
            'claude-3-sonnet' => ['input' => 0.003, 'output' => 0.015],
            // ... more models
        ],
    ],

    // Compression middleware
    'middleware' => [
        'auto_compress' => false,
        'min_response_size' => 1024,
    ],
];

Use Cases

1. ChatGPT Prompt Optimization

$prompt = "Analyze this dataset with millions of records...";
$data = $largeDataset;

$optimized = [
    'system_message' => 'You are an expert data analyst',
    'user_prompt' => $prompt,
    'data' => toon_compact($data),
];

// Save 60% of tokens
$tokens = toon_estimate_tokens(json_encode($optimized));

2. RAG with Optimized Context

$contextData = $database->search('query', 1000);

$ragPrompt = [
    'context' => toon_compact($contextData),
    'query' => 'User question',
];

$cost = toon_cost_estimate('gpt-4o', $ragPrompt);
// Significantly reduces costs

3. Cost Monitoring

// In your controller
public function sendToAI(Request $request)
{
    $data = $request->validated();
    
    $budget = toon_budget_analysis('gpt-4o', 100, $data);
    
    if (!$budget['within_budget']) {
        return response()->json([
            'error' => 'Exceeds token budget'
        ]);
    }
    
    // Proceed...
}

Testing

use Squareetlabs\LaravelToon\Facades\Toon;

class ToonTest extends TestCase
{
    public function test_compression_ratio()
    {
        $data = ['users' => range(1, 1000)];
        $ratio = Toon::calculateCompressionRatio($data);
        
        $this->assertLessThan(0.4, $ratio); // Less than 40%
    }
}

Environment Variables

# LLM APIs
OPENAI_API_KEY=sk-...
OPENAI_API_BASE=https://api.openai.com/v1

ANTHROPIC_API_KEY=sk-ant-...

GEMINI_API_KEY=AIzaSy...

MISTRAL_API_KEY=...

# LaravelToon
LARAVEL_TOON_ENABLED=true

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a branch for your feature (`git checkout -b feature/AmazingFeature`)
  3. Commit your changes (`git commit -m 'Add AmazingFeature'`)
  4. Push to the branch (`git push origin feature/AmazingFeature`)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

About

LaravelToon is developed and maintained by SquareetLabs

Support

For support, create an issue in the repository or contact labs@squareet.com

LaravelToon v1.0.0 - November 14, 2025


  Files folder image Files (40)  
File Role Description
Files folder imageconfig (1 file)
Files folder imagesrc (1 file, 9 directories)
Files folder imagetests (1 file, 1 directory)
Accessible without login Plain text file .phpunit.result.cache Data Auxiliary data
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file EXAMPLES.md Doc. Documentation
Accessible without login Plain text file INSTALLATION.md Doc. Documentation
Accessible without login Plain text file phpstan.neon Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file pint.json Data Auxiliary data
Accessible without login Plain text file QUICKSTART.md Doc. Documentation
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file SUMMARY.md Doc. Documentation

  Files folder image Files (40)  /  config  
File Role Description
  Accessible without login Plain text file laravel-toon.php Aux. Configuration script

  Files folder image Files (40)  /  src  
File Role Description
Files folder imageAdapters (5 files)
Files folder imageConsole (1 directory)
Files folder imageFacades (1 file)
Files folder imageHelpers (1 file)
Files folder imageMiddleware (1 file)
Files folder imageRules (1 file)
Files folder imageServices (4 files)
Files folder imageToon (7 files)
Files folder imageTraits (1 file)
  Plain text file LaravelToonServiceProvider.php Class Class source

  Files folder image Files (40)  /  src  /  Adapters  
File Role Description
  Plain text file AnthropicAdapter.php Class Class source
  Plain text file BaseLLMAdapter.php Class Class source
  Plain text file GeminiAdapter.php Class Class source
  Plain text file MistralAdapter.php Class Class source
  Plain text file OpenAIAdapter.php Class Class source

  Files folder image Files (40)  /  src  /  Console  
File Role Description
Files folder imageCommands (4 files)

  Files folder image Files (40)  /  src  /  Console  /  Commands  
File Role Description
  Plain text file ToonAnalyzeCommand.php Class Class source
  Plain text file ToonBenchmarkCommand.php Class Class source
  Plain text file ToonConvertCommand.php Class Class source
  Plain text file ToonDashboardCommand.php Class Class source

  Files folder image Files (40)  /  src  /  Facades  
File Role Description
  Plain text file Toon.php Class Class source

  Files folder image Files (40)  /  src  /  Helpers  
File Role Description
  Plain text file helpers.php Class Class source

  Files folder image Files (40)  /  src  /  Middleware  
File Role Description
  Plain text file CompressResponse.php Class Class source

  Files folder image Files (40)  /  src  /  Rules  
File Role Description
  Plain text file ValidToonFormat.php Class Class source

  Files folder image Files (40)  /  src  /  Services  
File Role Description
  Plain text file CompressionMetrics.php Class Class source
  Plain text file CostCalculator.php Class Class source
  Plain text file TokenAnalyzer.php Class Class source
  Plain text file ToonService.php Class Class source

  Files folder image Files (40)  /  src  /  Toon  
File Role Description
  Plain text file Constants.php Class Class source
  Plain text file EncodeOptions.php Class Class source
  Plain text file Encoders.php Class Class source
  Plain text file LineWriter.php Class Class source
  Plain text file Normalize.php Class Class source
  Plain text file Primitives.php Class Class source
  Plain text file Toon.php Class Class source

  Files folder image Files (40)  /  src  /  Traits  
File Role Description
  Plain text file HasToonEncoding.php Class Class source

  Files folder image Files (40)  /  tests  
File Role Description
Files folder imageFeature (1 file)
  Plain text file TestCase.php Class Class source

  Files folder image Files (40)  /  tests  /  Feature  
File Role Description
  Plain text file ToonServiceTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads  
 100%
Total:0
This week:0