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

Laravel Database Jsonable Laravel Package

oza/laravel-database-jsonable

A Laravel package that adds JSON column support to Eloquent models, making it easy to store, retrieve, and cast structured JSON data in your database without custom accessors or mutators.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy (here: build vs. adopt): This is a decision-support input for whether to add a third-party dependency for JSON column handling in a Laravel data model, versus using the framework's native json column type plus Eloquent $casts = ['field' => 'array']. The package's core value proposition — serializing an array/object into a database column and hydrating it back on read — is already first-party Laravel behavior, so this assessment mainly informs a "don't add the dependency" call.
  • Data model shape / schema design: If the team is weighing a normalized relational schema against a semi-structured JSON column (e.g., flexible product attributes, arbitrary settings, third-party webhook payloads, feature-flag blobs), this package is a concrete example of the JSON-column pattern. It supports the conversation about where JSON columns are appropriate (sparse, schema-fluid, read-whole-object data) versus where they're an anti-pattern (data you need to filter, join, or aggregate on).
  • Roadmap scoping for "flexible fields" features: Useful as a reference implementation if the roadmap includes configurable custom fields, per-tenant settings, or metadata drawers. It demonstrates the ergonomics — attribute access, fill/retrieve — that a product spec would need to describe to engineering.
  • Use-case triage: Fits scenarios like audit/event payloads, integration webhooks, tenant configuration, and CMS-style content blocks. It does not fit reporting, search, or anything requiring indexed queries against nested keys.
  • Risk and dependency governance: With 19 stars, 0 dependents, and a single maintainer, this is a data point for dependency-review policy — particularly since the affected layer (persistence of core records) is the highest-blast-radius place to take on unmaintained code. This supports a standing decision about which tiers of the stack may accept low-maturity dependencies.

When to Consider This Package

Consider it only in narrow circumstances:

  • You are already using it. An inherited or legacy codebase that depends on it — though with 0 recorded dependents, this is unlikely to be a live concern.
  • You need a thin, explicit wrapper instead of Eloquent casts. If the team has a specific reason to avoid $casts (e.g., wanting fill/retrieve helpers on a non-Eloquent or non-standard model, or a dot-notation accessor pattern the native cast doesn't give you), the package may save a small amount of boilerplate — but that boilerplate is roughly 5–10 lines of a custom cast or accessor/mutator.
  • You are prototyping and want to defer decisions on schema shape, accepting that the JSON blob will later be normalized.
  • You are evaluating patterns, not adopting a dependency — as a reference for how to wrap JSON columns cleanly.

Look elsewhere (specifically: the framework) when:

  • You are on a supported Laravel version. Native json/text columns with array/object/collection casts, AsArrayObject, AsCollection, and ->whereJsonContains() / ->whereJsonLength() cover the described functionality. This is the default recommendation.
  • The data is queried, not just stored. Nested JSON filtering and aggregation are weak in MySQL/Postgres unless you add generated columns and indexes; a package won't fix that. Normalize.
  • Maintenance risk is unacceptable. One maintainer, low stars, no visible dependents, and no security-review surface means you own the code the moment it breaks against a new Laravel major. Vendor it or write the cast yourself.
  • You need multi-version support guarantees, CVE response, or SLAs. Not available here.

Adoption criteria, if you insist on a formal gate: at least one of (a) a genuinely missing native capability documented in a spike, (b) an existing internal fork you already maintain, or (c) a throwaway prototype with a scheduled removal date.

How to Pitch It (Stakeholders)

For executives: We evaluated a community Laravel package for storing JSON data in database columns. My recommendation is not to adopt it. The capability it provides — save an array to a column, read it back as an array — is built into the framework we already pay for, so the package adds a dependency without adding capability. Its community footprint is negligible (19 stars, zero known dependents, single maintainer), which means if it breaks on a framework upgrade, we own the fix. Cost of the native approach is effectively zero; cost of the dependency is a small but permanent maintenance and supply-chain liability in our data layer — the worst place to carry one.

For engineering: Use native Eloquent casting — $table->json('meta') plus protected $casts = ['meta' => 'array'] (or AsArrayObject/AsCollection for mutable/collection semantics). For querying, use whereJsonContains / whereJsonLength; if you need to filter or aggregate on a nested key at scale, promote it to a real column with an index rather than reaching for a package. If a specific ergonomic gap shows up in a spike, write a 10-line custom cast — that's cheaper to own than this dependency and it stays in our code review path.

Ask: Approve the "no new dependency" call and confirm the JSON-column usage guidance (sparse/flexible data yes; queried or joined data no) goes into our data-modeling standards.

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.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
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