balping/json-raw-encoder
Laravel helper for encoding JSON while preserving “raw” fragments (like JS functions or pre-encoded JSON) without extra quoting/escaping. Handy for configs and API payloads when parts must stay untouched, with a simple API and reliable output.
new Function(), or complex prototypes).json_encode).json-encoder).JSON.stringify with reviver functions).For Executives: "This package lets us send JSON responses with embedded JavaScript objects (e.g., callbacks, functions) directly from PHP/Laravel, enabling richer client-side interactivity without bloating frontend code. For example, we could ship a single API call that includes both data and the logic to render it—cutting development time for features like real-time dashboards or admin tools. The trade-off is minimal: a lightweight dependency with no active maintenance (though stable), and a small security risk if we’re not careful with untrusted data. Given [specific use case, e.g., ‘the new analytics dashboard’], this could reduce frontend work by [X]% and launch faster."
For Engineering:
*"The balping/json-raw-encoder package solves a gap in Laravel’s JSON serialization: it lets us include raw JavaScript objects (e.g., { callback: () => console.log('hello') }) in API responses. This is useful for:
spatie/json-encoder if we need active updates."*How can I help you explore Laravel packages today?