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

Hidden Entity Type Bundle Laravel Package

shapecode/hidden-entity-type-bundle

A Symfony bundle that adds a hidden entity form type, letting you pass entity IDs through hidden fields and have them automatically transformed back into Doctrine entities on submit—useful for forms that reference entities without showing a visible selector.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is a Symfony bundle, not a Laravel package — this is the single most important framing correction. It supplies a HiddenEntityType form type plus a Doctrine-backed data transformer that takes a hidden input value (typically an entity identifier) and resolves it back to a managed Doctrine entity during form submission. Its dependency graph is therefore Symfony Form + Doctrine Bridge + Doctrine ORM EntityManager. None of that exists in a Laravel request lifecycle, so "fit" against a Laravel stack is effectively zero without a Symfony runtime.

Where a Symfony application (or a Symfony-based admin/back-office service running alongside Laravel) is in the estate, the fit is good and idiomatic: it fills a small but real gap — hidden fields that must carry an entity reference without exposing a full entity choice widget.

Integration feasibility (Laravel). Not viable as a dependency. The equivalent behaviour in Laravel is roughly 20–40 lines: a hidden input, an exists: or Rule::exists() validation rule scoped to the tenant/owner, and route-model binding or a manual findOrFail in the form request. Reproducing the bundle's semantics is a half-day task and removes a third-party dependency entirely. The recommendation for a Laravel-primary stack is to reimplement, not integrate.

Technical risk.

  • Bus factor / abandonment. 28 stars, a single-maintainer profile, and a narrow scope mean the realistic risk is not a defect but a stall: no release compatible with the next Symfony major. The code surface is small enough that forking is cheap, which caps the downside — but the fork becomes ours to own.
  • Security surface. A hidden field is user-controlled. The bundle resolves whatever ID is posted into an entity unless the caller supplies validation and authorization. This is a textbook IDOR vector: swapping the posted ID can attach another tenant's record. The bundle does not solve authorization; it only solves hydration. Any adoption must pair it with a Voter/ACL check or a constrained query_builder.
  • Failure modes are exception-driven. Unresolvable IDs surface as TransformationFailedException unless invalid_message is configured, which is easy to get wrong and produces 500s rather than validation errors.
  • Low overall confidence. The 0.53 score is consistent with what the repository shows: correct, small, lightly maintained.

Key questions to resolve before any commitment.

  1. Which Symfony and Doctrine ORM majors are supported by the latest tagged release, and is that tag compatible with our pinned PHP version?
  2. Is ORM the only supported persistence layer, or is Doctrine ODM / custom object manager handled?
  3. Does the type expose hooks (query_builder, choice_value, invalid-message handling) sufficient to enforce tenant scoping and authorization at the form layer?
  4. Is there any commit or release activity in the last 12–18 months, and is there a stated support policy?
  5. Do we actually have a Symfony Form context in the target service, or are we evaluating this for a Laravel app where it cannot run?

Integration Approach

Stack fit. Decide first which runtime this is for. In a Symfony service: register the bundle in config/bundles.php, require the package, and use HiddenEntityType::class in the form builder with the class option. Clean, no adapters, hours of work. In a Laravel service: do not integrate — implement the equivalent locally with a hidden input, a scoped exists rule, and explicit authorization, and document the bundle as the reference design rather than a dependency.

Migration path. Because the package is a thin data transformer, there is no meaningful migration to plan in either direction — it is adopt-or-reimplement, not a platform shift. If we adopt in Symfony and later need to exit, the replacement is a custom DataTransformerInterface implementation plus a form type, which is a contained change in the forms layer with no data-model impact. Treat it as an easily reversed decision, which lowers the cost of a trial.

Compatibility. Pin explicitly. Verify the release's composer.json constraints against our Symfony and Doctrine majors rather than relying on the README; bundles in this size class often lag a major behind. Run composer why-not against our platform packages during the spike. Also confirm PHP version support, since the bundle predates or straddles PHP 8.x type changes depending on the tag.

Sequencing.

  1. Spike in a branch against a single low-risk form; confirm install, registration, and hydration round-trip.
  2. Verify the security posture on that one form: tenant scoping via query_builder, authorization check on submit, and a sane invalid_message.
  3. Decide adopt vs. fork vs. reimplement, and record the decision with the version pin.
  4. Only then roll to additional forms, one at a time, with the authorization pattern enforced as a review checklist item.

Operational Impact

Maintenance. Runtime maintenance is near zero — no background jobs, no schema, no config beyond bundle registration. The real cost is upgrade maintenance: expect to absorb Symfony major-version bumps ourselves once upstream activity stops. Budget a small annual allowance for a fork-and-patch, or accept the reimplementation path where maintenance is fully ours from day one but bounded at a few dozen lines.

Support. Community-only, no vendor, no SLA. Escalation path is a GitHub issue on a low-traffic repository. For anything on a revenue path, treat internal ownership as the default and the upstream repository as an optional convenience.

Scaling. Negligible. Each hidden entity field costs one primary-key lookup per submitted form. Watch for forms that stack several such fields plus collection types, where the per-field lookups compound into a modest N+1 pattern; batch preloading is the mitigation if it ever matters. This will not be a capacity constraint.

Failure modes to instrument and guard.

  • Stale or deleted entity ID — submission fails at transformation time; without invalid_message this reads as a 500, so ensure it degrades to a validation error and log the distinction.
  • Tampered ID (IDOR) — the highest-severity failure. Mitigate with tenant-scoped query_builder and an explicit authorization check in the controller or a Voter; do not rely on the field being hidden.
  • Cross-tenant leakage via find-style resolution — the bundle resolves by identifier, so scoping is the caller's responsibility every time. Make this a mandatory code-review checkpoint wherever the type is used.
  • Upstream abandonment surfacing as a blocked framework upgrade — detect early by tracking the dependency in the upgrade runbook.

Ramp-up. For a developer already fluent in Symfony Forms and Doctrine, effectively zero — under an hour to first productive use, and the concepts are standard. For a Laravel-only team, the bundle itself is not learnable-and-usable, because the surrounding Form component is absent; the relevant ramp-up is the half-day to write the equivalent, and the conceptual transfer (hidden field + existence validation + authorization) is immediate. Net: low training cost either way, with the caveat that the "adopt the package" path only exists for teams already on Symfony.

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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib