camspiers/json-pretty
Pretty-print JSON in PHP 5.3. camspiers/json-pretty provides a simple JsonPretty class with a prettify() method to format arrays/JSON into readable, indented output. Install via Composer and use in a few lines.
json_encode($data, JSON_PRETTY_PRINT) calls (PHP 5.4+) with a more maintainable, centralized solution in older PHP 5.3 projects.JSON_PRETTY_PRINT flag exists in json_encode() (no dependency needed).json-formatter or symfony/var-dumper).barryvdh/laravel-debugbar (includes JSON prettification).json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES).php -r 'echo json_encode($argv[1], JSON_PRETTY_PRINT);' or jq.For Executives: "This package lets us standardize JSON formatting across our stack with minimal effort—improving debuggability and developer velocity. For ~5 lines of code, we can replace manual formatting (or native PHP flags) with a consistent, maintainable solution. Low risk: MIT-licensed, no dependencies, and works in legacy PHP 5.3 environments. Ideal for quick wins in observability or API tooling."
For Engineering: *"Pros:
app()->make(JsonPretty::class)->prettify($data)).app/Exceptions/Handler.php or Laravel Telescope.Cons:
json_decode() for parsing.Example use case: Add to config/app.php as a singleton or bind it in a service provider for global access. Tradeoff: Tiny package vs. native PHP flags (if PHP ≥ 5.4)."*
How can I help you explore Laravel packages today?