Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Supports Laravel Package

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...

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Modular Utility Layer: The package remains a framework-agnostic trait/utility library (HTTP traits, array/config helpers, pipeline, and now a JSON helper). It aligns with Laravel's trait-driven, service-provider-mediated architecture, making it suitable for shared services (API clients, data transformers) across monoliths and microservices.
  • Pipeline Compatibility: Still supports a Laravel-style pipeline abstraction, enabling reusable request/data processing chains. Value over Illuminate\Pipeline remains marginal unless the package is already in the dependency graph.
  • New JSON Utility (Yansongda\Supports\Json): Adds a thin, exception-first wrapper over native json_encode()/json_decode(). Architecturally this is a convenience layer, not a new capability — Laravel and PHP 8.2 already offer JSON_THROW_ON_ERROR and Illuminate\Support\Js. Treat it as standardization glue (one encoding policy across services) rather than a reason to adopt.
  • Legacy Adaptability: Integration still requires custom Service Provider / Facade wiring. The package provides no Laravel service provider, config publishing, or container bindings — that burden stays with us.

Integration Feasibility

  • Tightened Runtime Floor: The runtime requirement has moved from PHP 8.0+ to PHP >= 8.2. This is the single most consequential change in the release and effectively gates the package to Laravel 11/12 (Laravel 10 only where PHP 8.2 is already deployed). Adoption is no longer "incremental on any Laravel 9 app."
  • Near-Zero-Friction Utilities: Json::encode()/decode() can be adopted file-by-file with no container, config, or bootstrapping changes. Lowest-risk entry point in the package.
  • Trait Injection: HasHttpRequest still needs explicit mixin/container wiring; unchanged effort.
  • Default Flag Divergence: Json::encode() defaults to JSON_UNESCAPED_UNICODE (native default is 0) and Json::decode() defaults to associative arrays. Behavior differs from native calls unless flags are passed explicitly — a subtle consistency trap across a codebase.

Technical Risk

  • Stale-Maintenance Risk Resolved (materially): The prior assessment flagged "last release 2020" and recommended forking or monitoring. With v4.1.3 published 2026-10-10, the package is actively maintained. This removes the primary disqualifier and changes the recommendation from avoid/fork to evaluate/adopt selectively.
  • Two Major Versions of Unknown Breaking Surface: We are jumping from the assessed v2.2.0 to v4.1.3, spanning v3.0.0 (logger removal) and v4.0.0 (contents unreviewed). The release notes provided cover only v4.1.3. A full diff review of v3.x and v4.x breaking changes is mandatory before any upgrade path is committed.
  • PHP 8.2+ Hard Gate: Any service still on Laravel 9/10 with PHP 8.1 is blocked. This is a breaking constraint relative to the previous assessment and may strand partially-migrated services.
  • Exception-Driven Failure Semantics: Json::decode('{bad') now throws \JsonException where native returns null. Uncaught in controllers/jobs, this converts previously silent bad-input handling into 500s. Requires an explicit error-handling convention.
  • Overlap with Native/Laravel Primitives: json_encode($v, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE) delivers identical behavior with zero dependency. The marginal utility is convention enforcement, not capability.
  • Trait Pollution & Method Collisions: Unchanged risk for HasHttpRequest in large codebases.
  • Documentation Locale: Release notes and examples are Chinese-only; onboarding and support expectations should account for that.

Key Questions

  1. Version Gap:
    • What broke in v3.0.0 and v4.0.0 beyond logger removal? Is there a complete changelog/UPGRADE guide, and who owns reviewing it?
    • Is the v2.2.0 → v4.1.3 jump a supported upgrade path, or effectively a re-adoption decision?
  2. Runtime Gate:
    • Which services are on PHP < 8.2? Are they in scope now, and does the upgrade force a Laravel/PHP upgrade we haven't funded?
  3. JSON Utility Value:
    • Does Json replace all ad-hoc json_encode/json_decode calls, or just new code? A partial rollout creates two encoding conventions.
    • Will we standardize on Json::encode()'s JSON_UNESCAPED_UNICODE default, and does any downstream consumer (logs, API signatures, cache keys, hashing) depend on escaped output?
    • What is the exception handling policy — global handler mapping, or per-call try/catch?
  4. Alternatives:
    • Is JSON_THROW_ON_ERROR + a one-line internal helper sufficient, avoiding the dependency entirely?
    • Does spatie/array / Laravel Arr still cover the array/config utilities better?
  5. Ownership:
    • Do we pin an exact version, and who monitors for the next major given the 2020 → 2026 release cadence?

Integration Approach

Stack Fit

  • Laravel 11/12 (PHP 8.2+): Best and now effectively only clean fit. Guzzle 7.x and PHP 8.2 line up with the framework baseline.
  • Laravel 10 (PHP 8.2): Viable only where PHP has already been upgraded; otherwise blocked.
  • Laravel 9 / PHP 8.0–8.1: No longer supported. Requires retaining an older package major (pre-4.x) — do not mix majors across services.
  • Non-Laravel PHP 8.2+: Framework-agnostic; traits require manual DI wiring.

Migration Path

  1. Assessment & Planning
    • Diff v3.0.0 and v4.0.0 changelogs; enumerate breaking changes and map each to affected code.
    • Inventory all json_encode/json_decode call sites (including false-return and json_last_error() checks) to size the Json adoption surface.
    • Confirm PHP runtime per service; exclude any service below 8.2 from this wave.
    • Identify remaining logger dependencies (already removed in v3.0.0) and confirm replacement with Log.
  2. Phase 1 — Upgrade the Dependency
    • Bump to ^4.1 in composer.json on a single pilot service; run the full test suite.
    • Pin the exact version; record it in the dependency register.
  3. Phase 2 — Adopt Json in One Service
    • Introduce Json::encode()/decode() in a bounded module first.
    • Establish a coding convention: always pass explicit $flags where native parity is required; never rely on the default silently.
    • Add a global exception mapping or wrapper so \JsonException maps to a 422/bad-request rather than a 500.
  4. Phase 3 — Standardize or Reject
    • Either roll the convention org-wide (lint rule / static analysis to catch raw json_encode), or deliberately stop at the pilot and drop the dependency.
  5. Phase 4 — Traits & Pipeline (only if independently justified)
    • Wire HasHttpRequest via Service Provider mixin or container binding; alias methods to avoid collisions.
    • Replace custom pipeline logic only where the package adds demonstrable value over Illuminate\Pipeline.

Compatibility

Feature Compatibility Workaround
PHP >= 8.2 ✅ Laravel 11/12 Blocks Laravel ≤10 on PHP < 8.2 — defer those services
Guzzle 7.x ✅ Laravel 9+ baseline Wrapper facade if a service pins Guzzle 6
Json utility ✅ Drop-in, no wiring Pass explicit flags for native parity
Json::decode() exceptions ⚠️ Changes failure semantics Global handler mapping / try-catch convention
JSON_UNESCAPED_UNICODE default ⚠️ Differs from native Pass 0 where escaped output is expected
Array/Config utilities ✅ Works alongside Arr Use selectively; compare with spatie/array
HasHttpRequest trait ⚠️ Not Laravel-native Container binding + method aliases
Pipeline support ✅ Compatible Only adopt if it beats Illuminate\Pipeline
Removed logger (v3.0.0) ❌ Breaking for legacy code \Log:: facade
Undocumented v4.0.0 changes ⚠️ Unknown Full changelog diff required before upgrade

Sequencing

  1. Changelog diff review (v2.2.0 → v4.1.3) and risk sign-off — gate for everything else.
  2. Runtime audit — confirm PHP 8.2+ across candidate services.
  3. Pilot dependency bump on one low-blast-radius service.
  4. Json adoption + exception convention in that service only.
  5. Go/no-go checkpoint: measure whether the wrapper reduced defects/boilerplate versus native JSON_THROW_ON_ERROR.
  6. Traits/pipeline evaluated separately, only on demonstrated need.
  7. Org-wide rollout or dependency removal — no partial, indefinite middle state.

Operational Impact

Maintenance

  • Improved: Active releases (2026) replace the prior 2020-era abandonment risk. Forking is no longer the default recommendation.
  • Cadence remains irregular: A 2020 → 2026 gap means major-version jumps are large and infrequent. Budget explicit upgrade work rather than assuming continuous small deltas.
  • Ownership required: Someone must own changelog review, version pinning, and upgrade testing; the package will not surface Laravel-facing breaking changes for us.

Support

  • Community-maintained, no vendor SLA. Support channel is upstream issues; documentation and release notes are Chinese-language.
  • No Laravel-native support surface (no service provider, no published config). Internal integration knowledge must be documented by us, not inherited.
  • Internal enablement cost: a short internal note on the Json convention and the exception policy.

Scaling

  • Negligible runtime cost: Json is a thin wrapper over native functions; traits compile away. No measurable throughput or memory impact.
  • Scaling concern is consistency, not performance: two coexisting JSON encoding conventions across services is the real scaling risk as the codebase and team grow.
  • Trait usage does not scale gracefully: broad mixin of HasHttpRequest across many classes increases collision surface; prefer a small number of explicitly-composed service classes.

Failure Modes

  • Uncaught \JsonException → HTTP 500s / failed jobs where previously null or false was tolerated. Highest-probability new failure. Mitigation: global handler mapping + mandatory tests for malformed payloads.
  • Silent payload divergence from the JSON_UNESCAPED_UNICODE default (e.g., differing cache keys, request signatures, log parsers, snapshot tests). Mitigation: lint rule enforcing explicit flags.
  • Associative-array default in Json::decode() breaks consumers expecting stdClass (e.g., property access). Mitigation: pass $assoc = false explicitly at those call sites.
  • Version-major mismatch across services (pre-4.x and 4.x in one estate) producing inconsistent behavior. Mitigation: pin and align majors.
  • Trait method collisions on broad mixin adoption. Mitigation: aliasing and code review.
  • PHP floor breach — a service silently on 8.1 breaks at install time. Mitigation: CI platform check.

Ramp-up

  • Low technical ramp-up: small API surface; Json is learnable in minutes.
  • Moderate process ramp-up: the real effort is (a) the v3/v4 breaking-change review, (b) agreeing on the JSON convention and exception policy, and (c) PHP 8.2 gating decisions.
  • Language consideration: Chinese-only upstream docs mean onboarding relies on internal documentation rather than upstream references.
  • Recommended first step: a single-service pilot covering the version bump plus Json adoption, with an explicit go/no-go on whether the wrapper justifies the dependency over native JSON_THROW_ON_ERROR.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums