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

Json Laravel Package

laragear/json

Laragear/Json makes JSON columns in Laravel easy to work with: cast attributes to typed objects, validate nested data, query values cleanly, and keep Eloquent models tidy. A lightweight toolkit for structured, schema-friendly JSON storage.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. Laragear/Json is a single-purpose Laravel package: a model cast plus an object wrapper that lets application code read and mutate individual keys inside a JSON column and persist only those keys (UPDATE ... JSON_SET / jsonb_set / json_set) instead of rewriting the whole document. Architecturally it is a thin library with no service, daemon, or schema footprint, so it slots into any Laravel app that already leans on JSON columns. Fit is high where JSON columns are load-bearing and multiple writers touch different keys of the same row; low where JSON is incidental and a native array/AsArrayObject cast is sufficient. It is community-maintained by a single author (Laragear / Italo Barragan), not first-party Laravel — that is the dominant architectural caveat, not the code itself.

Integration feasibility. Composer-installable, optional config publish. The real cost is not installation but call-site migration: every place that reads the attribute as an array must move to the wrapper's accessor API (get/set/has/forget/save), and every $casts entry must change. That is a mechanical but wide refactor, and it is the reason the major-version boundary matters more here than for a typical dependency.

Technical risk. v4.0.0 is a major bump, and the release body is a changelog link with no explicit breaking-change callout, no migration guide, and no stated minimum PHP/Laravel. That absence is itself the primary risk signal — a TPM cannot scope an upgrade from this artifact alone. Concrete risk vectors to verify: renamed or removed cast/class names; changed return semantics (e.g. missing key returning null vs. a default); changed JsonSerializable output, which would silently alter API resource payloads; raised PHP/Laravel floors that force an app upgrade first; and driver-parity regressions in the partial-update SQL, which is the highest-severity failure mode because it corrupts data rather than throwing. Single-maintainer bus factor and a small user base mean upstream regressions are found late.

Key questions. What specifically broke between 3.x and 4.x? What are the new PHP/Laravel/driver minimums? Is there an upgrade guide, and is 3.x still receiving fixes for how long? Are cast names and public method signatures stable across the major? Is the CI matrix exercising MySQL, Postgres, and SQLite at parity? What is the test coverage and release cadence? Is there a sponsorship/commercial support path, and is anyone else in the org already depending on this package at a different major?

Integration Approach

Stack fit. Targets modern Laravel on PHP 8.1+. Confirm the app's DB engine explicitly: MySQL 8+ and Postgres 12+ are fine; SQLite needs a recent enough version for json_set; MariaDB's JSON support is a known gap and should be treated as a blocker until proven otherwise.

Migration path. Pin ^3.0 on the current branch and disable automatic major upgrades (Dependabot/Renovate major ignores). Run a time-boxed spike branch on ^4.0: bump, run the full suite, and diff serialized output of one representative model before and after. Derive the actual breaking-change list by reading the repo changelog and diffing the public API — do not rely on the release notes.

Compatibility and sequencing. First confirm package constraints against the app's PHP/Laravel locks; if v4 requires a Laravel major the app has not adopted, the package upgrade is blocked behind the framework upgrade and should be sequenced after it. Then: prototype on one low-risk model → contract-test JSON serialization for API resources → roll out model by model → only then drop the ^3.0 allowance. Do not adopt 4.0.0 on release day; wait for 4.0.x patches to surface early-adopter breakage, and set a review date rather than an open-ended "someday."

Operational Impact

Maintenance and support. Single-maintainer OSS with community-issue support and no SLA. Mitigations: assign a named internal owner, track upstream releases on a cadence (quarterly is adequate), and accept that the escalation path is "we patch or we fork." The package is small enough — a cast plus a JSON path helper — that vendoring is a credible fallback and should be priced in, not assumed away.

Scaling. Runtime overhead is negligible. The partial-update model is in fact better than array casts under concurrency, since it avoids lost updates when two requests touch different keys of the same row. The scaling caveat is call pattern, not throughput: looping save() per key multiplies round-trips and should be batched into one write. Absent optimistic locking, save() on a stale object can still clobber a concurrent write to the same key — document that boundary for engineers.

Failure modes. Silent data loss from driver-specific JSON path handling; lost updates on stale objects; exceptions or null-column edge cases when the wrapper assumes an initial {}; and serialization drift across majors that shows up as changed API responses rather than failing tests.

Ramp-up. Low for engineers — the API reads like a collection, and the only real conceptual shift is distinguishing in-memory mutation from explicit save(). One brown-bag session plus a short internal note on the stale-object caveat is sufficient. The TPM-side ramp-up is the larger cost: with release notes this thin, someone must own reading upstream changelogs and diffs, and that ownership should be explicit before the dependency is adopted.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console