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() with JSON_PRETTY_PRINT flag (PHP 5.4+), making this package redundant for core JSON formatting needs. The package targets PHP 5.3, which is 10+ years outdated and unsupported.JSON_PRETTY_PRINT), Symfony’s Serializer, or Laravel’s response()->json() with formatting overrides are superior choices.require), but no Laravel-specific hooks (e.g., service providers, facades, or middleware) exist.JSON_PRETTY_PRINT or Laravel’s built-in response()->json()?Json::prettify()).$json = json_encode($array, JSON_PRETTY_PRINT);
return response()->json($array, 200, [], JSON_PRETTY_PRINT);
autoload.php inclusion, but no Laravel-specific optimizations.JSON_PRETTY_PRINT is faster.ext-json).ext-json or other PHP 5.3 extensions are deprecated, this package will break.json_encode behavior differences).How can I help you explore Laravel packages today?