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 Metadata Laravel Package

jobmetric/laravel-metadata

A Laravel package for attaching flexible key-value metadata to Eloquent models. It offers polymorphic metadata storage, simple trait-based integration, and helpers to set, get, update, and query metadata without changing your existing database schema.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy on "custom fields." The recurring product request — "let admins add extra attributes to products/contacts/tickets without a migration" — maps directly onto a metadata (key/value attached to Eloquent models) package. This is a buy decision at the low end of the cost curve, not a platform bet.
  • Feature scoping: schema flexibility vs. schema discipline. Choosing a metadata bag means committing to runtime-defined attributes. That decision shapes admin UI, validation strategy, API contracts, and reporting — decide it before the roadmap hardens around fixed columns.
  • Roadmap sequencing. Lets you ship a v1 with a generic metadata store and defer bespoke columns and per-tenant schema work. Useful for MVPs, internal tools, and multi-tenant products where each customer wants slightly different fields.
  • Settings, flags, and annotations. A single mechanism can back lightweight app/tenant settings, per-record annotations, import provenance, and integration IDs — reducing the number of one-off tables and migrations the team maintains.
  • Use cases that fit well: CMS-adjacent content models, CRM-style records with customer-specific fields, e-commerce catalog extensions (specs, compliance notes), internal admin tooling, import/sync pipelines that carry third-party payloads.
  • Use cases that do not: anything where metadata must be filtered, sorted, or aggregated at scale in the primary query path, or where attributes are business-critical and need strict typing and referential integrity.
  • Portfolio signal. Low adoption (11 stars, low composite score) means this is an evaluation candidate, not a standard. A PM decision here is really "fund a half-day spike," not "adopt."

When to Consider This Package

Consider it when all of these hold:

  • You need to attach arbitrary key/value metadata to multiple, unrelated Eloquent models (polymorphic), not one table with a JSON column.
  • The metadata is read-mostly or lightly queried — display, export, admin editing — rather than the backbone of search, filtering, or analytics.
  • You want to avoid owning the storage abstraction: migrations, casting, retrieval helpers, cleanup on model delete.
  • The team is Laravel-native and comfortable reading the package source; MIT license and a recent release (Sept 2025) mean you can fork or vendor it if needed.
  • You accept a small dependency: single maintainer, minimal community, no ecosystem gravity. Budget for a code read and a migration/upgrade plan.

Look elsewhere — or build in-house — when:

  • You need typed attributes, validation rules, or a schema registry per entity. A raw metadata bag pushes that complexity into your application layer, where it is harder to enforce and test.
  • You need query performance over metadata (faceted search, reporting, joins). Prefer dedicated columns, JSON columns with database-level indexing, or a search index.
  • Compliance, audit, or data-residency requirements apply — a lightly-adopted third-party package is a poor place to concentrate that risk.
  • The metadata is tenant-isolated and you need guaranteed scoping; verify the package's behavior under multi-tenancy before committing.
  • You only need one model's extra fields: a json column with Eloquent casts is less code and less dependency than a package.
  • A better-supported alternative already fits (e.g., a schemaless-attributes style package with active maintenance) — prefer the one your team can get support for.

Adoption gate: run a timeboxed spike that covers polymorphic attach/detach, eager loading, cascade deletes, and one realistic read path. If the spike needs more than a day, the package is not saving you anything.

How to Pitch It (Stakeholders)

For executives (one paragraph): Customers keep asking for fields we didn't build. Today each request is a schema change, a migration, and a release. A metadata package lets us store those extra attributes generically, so we can ship an admin-configurable "custom fields" capability in days instead of quarters, and stop spending engineering time on one-off columns. It is a small, MIT-licensed Laravel library, so the cost is low and reversible — but it is also a low-adoption package, so my recommendation is a short technical evaluation followed by a fork-and-own decision, not a blind dependency. Expected outcome: faster response to customer-specific requirements, less schema churn, and a contained, well-understood piece of infrastructure.

For engineering (the ask): Evaluate jobmetric/laravel-metadata as the storage layer for polymorphic model metadata. Specifically confirm: (1) the data model and indexes — can we query metadata efficiently enough for our admin screens; (2) lifecycle behavior — cascading deletes, soft deletes, and orphan cleanup; (3) multi-tenancy and authorization implications of a global key/value table; (4) casting/serialization and how we enforce validation, since the package will not; (5) upgrade surface and whether we fork. Success criteria: a spike covering attach/read/list/delete on two models plus one filtered admin list, and a written recommendation of adopt, adopt-and-fork, or build a 60-line trait instead. If we adopt, we own the abstraction: wrap it behind our own service so the package is replaceable and the rest of the codebase never imports it directly.

Framing for the decision: treat this as an internal capability bet with a small blast radius. The real commitment is not the package — it is the product promise of user-defined fields, which brings validation, permissions, and reporting obligations. Approve the spike; defer the product commitment until the spike tells us what the storage layer can actually support.

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