yansongda/supports
Supports is a small PHP utility library from the yansongda ecosystem that simplifies working with arrays, configuration, and pipelines. It provides handy helpers for array access and manipulation, config handling, and pipeline processing, making it useful for Laravel or PHP projects that need lightw...
Yansongda\Supports\Json with Json::encode() and Json::decode(). It throws \JsonException on failure (code maps to JSON_ERROR_*), removing reliance on false/null return checks or json_last_error(). encode() defaults to JSON_UNESCAPED_UNICODE, which is useful for Chinese-language or Unicode-heavy API payloads; pass 0 to restore native escaping behavior.Json::encode() defaults to avoid \uXXXX escaping in API responses.false/null checks and json_last_error().HasHttpRequest) align with your existing Laravel architecture (Form Requests, Services).Log facade).json_encode()/json_decode() or a dedicated serializer may fit better.For Executives:
“This package reduces development time for repetitive backend work—HTTP calls, data transformations, and now JSON handling. v4.1.3 adds Json::encode()/Json::decode() with exception-based failure handling, which reduces silent JSON errors in API integrations and third-party payload processing. It also shows the package is still maintained, lowering abandonment risk. The MIT license and lightweight footprint make it a low-risk accelerator for API-heavy roadmap items—provided our runtime is already on PHP >=8.2. It won’t change the roadmap, but it can shorten delivery time for integrations and internal tools.”
For Engineering: ✅ Pros:
Json::encode()/Json::decode() throws \JsonException on failure, with JSON_ERROR_* codes; avoids false/null ambiguity and manual json_last_error() checks.Json::encode() defaults to JSON_UNESCAPED_UNICODE; pass 0 for native escaping.HasHttpRequest trait standardizes Guzzle usage (timeouts, retries) across services, reducing API-related bugs.Pipeline.⚠️ Cons:
Log facade.📌 Recommendation:
Json at API boundaries where silent JSON failures are costly; standardize exception handling and logging around \JsonException.HasHttpRequest in Form Requests or Services.spatie/array for config utilities, native JSON or dedicated serializers where appropriate) if package scope is too narrow.For Product/Design: “This won’t change your roadmap, but it can reduce backend dev time for features that call third-party APIs or transform JSON data. v4.1.3’s JSON utility means fewer silent failures and cleaner error handling in integrations. The main caveat is runtime: the team must be on PHP >=8.2. If we already are, this is a low-risk way to speed up backend delivery without adding product tradeoffs.”
How can I help you explore Laravel packages today?