PHPackages                             scon/laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. scon/laravel

ActiveLibrary[API Development](/categories/api)

scon/laravel
============

SCON — Schema-Compact Object Notation: Laravel integration with response macros, request parsing, and Facade

00PHP

Since Mar 16Pushed 1w agoCompare

[ Source](https://github.com/QuijoteShin/scon-laravel)[ Packagist](https://packagist.org/packages/scon/laravel)[ RSS](/packages/scon-laravel/feed)WikiDiscussions init Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

scon/laravel
============

[](#sconlaravel)

**SCON — Schema-Compact Object Notation for Laravel**

Laravel integration for SCON. 59-66% payload reduction, 64% fewer LLM tokens, zero config.

[![Packagist](https://camo.githubusercontent.com/5949a098722df211599040d8d32e0c172268b6df9954774eb323925de867e7f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73636f6e2f6c61726176656c2e737667)](https://packagist.org/packages/scon/laravel)[![License: MIT](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Install
-------

[](#install)

```
composer require scon/laravel
```

Auto-discovery registers the service provider and facade. No config file needed.

Usage
-----

[](#usage)

### Facade

[](#facade)

```
use Scon\Laravel\Facades\SCON;

# Encode
$scon = SCON::encode(['name' => 'scon', 'version' => 1]);

# Decode
$data = SCON::decode($sconString);

# Minify / Expand
$mini = SCON::minify($sconString);
$expanded = SCON::expand($mini);

# Structural dedup (59-66% reduction on repetitive data)
$scon = SCON::encode($data, ['autoExtract' => true]);

# Check if Rust extension is loaded
$fast = SCON::isAccelerated(); // true if php-scon ext is available
```

### Response macro

[](#response-macro)

```
# Return SCON response with Content-Type: text/scon
return response()->scon($data);
return response()->scon($data, 201);
return response()->scon($data, 200, ['X-Custom' => 'header']);
```

### Request macros

[](#request-macros)

```
# Parse SCON request body
$data = $request->scon();

# Check if request is SCON
if ($request->isScon()) {
    $data = $request->scon();
}
```

### API example

[](#api-example)

```
Route::post('/api/config', function (Request $request) {
    if ($request->isScon()) {
        $config = $request->scon();
    } else {
        $config = $request->json()->all();
    }

    return response()->scon([
        'status' => 'saved',
        'entries' => count($config),
    ]);
});
```

Native acceleration
-------------------

[](#native-acceleration)

`scon/laravel` uses `scon/scon` which auto-detects the Rust native extension when available. No code changes needed — `SCON::encode()` and `SCON::decode()` transparently use the tape decoder for near-parity with `json_decode`.

```
# Check acceleration status
php -r "require 'vendor/autoload.php'; echo Scon\Scon::isAccelerated() ? 'native' : 'pure PHP';"
```

Performance
-----------

[](#performance)

Payload reduction on OpenAPI 3.1 spec (71 endpoints):

FormatBytesRatioJSON90,8861.00xSCON26,3470.29xSCON (minified)20,2110.22xLLM token efficiency (cl100k\_base): **64% fewer tokens** — less context window waste for RAG pipelines, tool-use agents, and structured prompts.

Full methodology: [DOI 10.5281/zenodo.14733092](https://doi.org/10.5281/zenodo.14733092)Benchmarks, optimization log (21 phases), and industrial protocol fixtures: [github.com/QuijoteShin/scon](https://github.com/QuijoteShin/scon)

Also available
--------------

[](#also-available)

- **Rust**: `cargo add scon` — [crates.io/crates/scon](https://crates.io/crates/scon)
- **JavaScript**: `npm install scon-notation` — [npmjs.com/package/scon-notation](https://www.npmjs.com/package/scon-notation)
- **PHP (standalone)**: `composer require scon/scon` — [packagist.org/packages/scon/scon](https://packagist.org/packages/scon/scon)

License
-------

[](#license)

MIT

###  Health Score

20

—

LowBetter than 16% of packages

Maintenance64

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b21d432382ff25be54ea8ec90dcb3d300f206b2481ffe5433e35e9e95ea8ea43?d=identicon)[QuijoteShin](/maintainers/QuijoteShin)

---

Top Contributors

[![QuijoteShin](https://avatars.githubusercontent.com/u/4658549?v=4)](https://github.com/QuijoteShin "QuijoteShin (1 commits)")

### Embed Badge

![Health badge](/badges/scon-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/scon-laravel/health.svg)](https://phpackages.com/packages/scon-laravel)
```

###  Alternatives

[google/apiclient

Client library for Google APIs

9.8k186.9M901](/packages/google-apiclient)[stripe/stripe-php

Stripe PHP Library

4.0k139.3M419](/packages/stripe-stripe-php)[webonyx/graphql-php

A PHP port of GraphQL reference implementation

4.7k75.4M279](/packages/webonyx-graphql-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k90.6M252](/packages/twilio-sdk)[friendsofsymfony/jsrouting-bundle

A pretty nice way to expose your Symfony routing to client applications.

1.5k52.7M208](/packages/friendsofsymfony-jsrouting-bundle)[knplabs/github-api

GitHub API v3 client

2.2k15.3M171](/packages/knplabs-github-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
