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

Metadata Bundle Laravel Package

sylius/metadata-bundle

Sylius Metadata Bundle adds flexible, arbitrary metadata to Sylius resources and entities, letting you extend data models without schema changes and keep custom attributes organized.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is a Symfony bundle, not a Laravel package. What ships is DI/config glue — service definitions, Doctrine mapping registration, a container extension, a Doctrine event subscriber, and a form type — wrapped around the sylius/metadata component's object-metadata model. In a Laravel application the bundle layer is dead weight: it assumes Symfony's kernel, bundle registration, and Doctrine ORM as the persistence layer. The transferable asset is the design: a metadata row addressed by (subject_class, subject_id, key) that attaches to any subject object without altering that object's table, plus a subject-side interface (MetadataSubjectInterface) that makes the association feel native. The 5.87 opportunity score against a 0.0225 package score should be read as "the problem space is real and underserved," not "this artifact is viable." Treat it as prior art, not a dependency.

Integration feasibility. Composer-installable in principle, but in a Laravel app you would be bootstrapping a parallel Symfony container path purely to obtain one table, one repository, and a lifecycle hook. Laravel already gives you the better primitives: polymorphic Eloquent relations (metadatable_type/metadatable_id), JSON/JSONB columns with casts, model observers or events standing in for the Doctrine subscriber, and service-container bindings for the repository contract. Realistic effort to reach feature parity in Laravel is 2–4 days for a prototype with tests, versus days spent fighting Symfony/Doctrine version constraints to get the bundle booting at all.

Technical risk. Realized, not speculative. The repository is archived and read-only: no patch stream, no security response, no compatibility work for current PHP, Symfony, or Doctrine majors. Doctrine ORM 3's move away from annotation mapping is a likely break, and the bundle's mapping files and event subscriber are exactly the surfaces that would fail. Three stars and zero dependents means no ecosystem triage — no downstream bug reports, no de facto compatibility testing, no one else to discover breakage first. Verify the license permits forking before planning around it, and expect dependency scanners to flag the package as abandoned for as long as it sits in composer.json.

Key questions.

  • What is the actual requirement: string-only values, typed values, per-subject namespacing, or queryable/filterable metadata? "Queryable" changes the schema decision entirely and usually argues against a pure key-value blob.
  • Is metadata customer-facing configuration (merchant-defined product attributes) or internal annotation (tags, CRM ids, flags)? The former needs validation, UI, and audit; the latter needs almost none.
  • Do we need history/audit of metadata changes, and is that in scope now or later?
  • Does subject identity survive renames and re-seeding? subject_class is a hard-coded FQCN in the row — renaming a model silently orphans data.
  • Is multi-tenancy in play? Metadata rows will need tenant scoping at the index level, not in application code.
  • Who owns the implementation if we port it, and what is the review cadence on the internal package?
  • Is there a maintained successor (metadata folded into Sylius core or the standalone component) that supports PHP 8.2+ and current Doctrine, and does it matter to us on Laravel?

Integration Approach

Stack fit. Poor. Do not present this to stakeholders as a Laravel candidate; it will fail integration on container and ORM assumptions, not on code quality. It is viable only inside an existing Sylius/Symfony application already pinned to a compatible version set — in that case the decision is "vendor or replace," not "adopt."

Migration path. Do not require the archived bundle. Two acceptable shapes: (a) read the source and reimplement the schema and repository contract natively — a metadata migration with metadatable_type, metadatable_id, key, name, value columns and a composite index, a HasMetadata trait providing metadata(), getMetadata(), addMetadata(), and a MetadataRepository bound to an internal MetadataStore interface; or (b) if you genuinely need the PHP component's classes, vendor them into an internal namespace. In Laravel, (a) is almost always correct — Eloquent's morph relations and ->metadata eager loading replace the Symfony subscriber's postLoad hydration entirely, and saving/deleted model events replace the on-flush identifier fill. Keep the columns similar to the original so the mental model carries over from the reference implementation.

Compatibility. Inspect Composer constraints before anything else and pin exact versions if the bundle must be touched at all. Expect annotation/XML Doctrine mapping requiring conversion to attributes, Symfony bundle config (sylius_metadata.classes.metadata.model) with no Laravel analog, and a Symfony form type that maps to a Laravel validation layer, a Filament field, or a Livewire component in our stack. In the Laravel port, the equivalents to watch are MySQL 8 functional indexes or Postgres GIN indexes on the value column if filtering is required, and cast definitions if we move to a JSON column. Treat "installs cleanly" and "works under our access patterns" as separate gates.

Sequencing.

  1. Pin down the data model and query patterns first — write-heavy audit-style metadata versus read-heavy joins to subjects drives every subsequent decision.
  2. Prototype migration + trait + repository in Laravel (2–4 days), including eager-loading of metadata on an index page to expose the N+1 shape early.
  3. Load-test the read path where metadata joins to subjects; measure query count per page, not just latency.
  4. Decide JSON column versus key-value table based on step 3 — if filtering by metadata is required, JSONB (Postgres) or a functional-index approach wins over pure key-value.
  5. Wrap everything behind the internal MetadataStore interface so a maintained package can be swapped in later at the cost of one adapter.
  6. If any bundle code is vendored, add CI, a PHP version matrix, static analysis, and an internal release tag; register the fork on the dependency-review list.

Operational Impact

Maintenance. Zero upstream. Every line adopted becomes owned code with a public lineage — budget it as an internal component, not a dependency. Dependency scanners will report it abandoned indefinitely, which becomes a recurring governance conversation each quarter until it is replaced or explicitly waived. The ported Laravel implementation is small enough (a migration, a trait, a repository, a handful of tests) that ownership cost is genuinely low, which is the strongest argument for reimplementing rather than forking.

Support. No maintainers, no issue triage, no advisories. Our security process must cover the code directly; do not assume Composer's abandoned flag will surface a CVE in time, and do not assume anyone upstream will respond to a report. If the bundle is inherited inside an existing Sylius install, name an internal owner on day one.

Scaling. Sparse key-value metadata joined to subjects is the classic N+1 and index-bloat shape. The bundle supplies mapping, not a query strategy. Plan a composite index on (subject_type, subject_id, key), cap value length, and prefer a JSON/JSONB column with database-side indexing when metadata must be filtered or sorted — pure key-value pushes those operations into application code, which degrades badly above modest volumes. Watch subject identity churn (model renames, ID reuse after re-seeding) silently orphaning rows, and watch write amplification on hot subjects if metadata is updated per request.

Failure modes. Container compile errors on version drift (Symfony path); ORM mapping incompatibility on Doctrine upgrades; schema drift during migrations; metadata loss when subject identifiers or FQCNs change; stale caches and proxy state in long-running workers (queue workers, Octane) where the subject was mutated outside the request lifecycle; transaction contention when many rows are written against the same subject in one flush. In the Laravel port, the analogous risks are orphaned morph rows after model renames, missing indexes causing table scans, and unbounded metadata growth on high-cardinality subjects.

Ramp-up. The codebase is small — a mid-level engineer can read the whole thing in a day, and the Laravel reimplementation is a few hours of ramp for anyone comfortable with Eloquent. The actual cost is contextual: reasoning about the Symfony version requires bundle conventions and Doctrine mapping knowledge, which the Laravel team will not have and does not need. Document ownership, the internal interface contract, and the version tag before the first deploy, and record explicitly why the third-party package was rejected so the next team doesn't relitigate it.

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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
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
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core