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

Product Decisions This Supports

  • Nested/child creation flows: "Add a comment to this Post," "Create an invoice line for this Order," "Invite a user to this Team" — patterns where a parent entity must accompany a form submission but should never be user-editable. This package lets Symfony Forms hydrate that parent from a hidden, server-validated reference instead of hand-rolling a transformer per form.
  • Multi-step wizards and checkout-style flows: carry an entity reference (cart, draft application, onboarding record) across steps without stuffing IDs into session state or re-fetching in every controller.
  • Build vs. buy (well, adopt): this is a single form type — a few dozen lines of a custom HiddenType + data transformer would replace it. The decision is really "one small third-party dependency vs. one small internal utility." Default should be internal unless the pattern appears in 3+ forms.
  • Framework roadmap signal: explicitly a Symfony bundle, not Laravel. If the roadmap is Laravel-first or framework-agnostic, this is a non-option and the equivalent is a custom HiddenEntity cast/rule or route-model-binding plus a hidden input. Treat this as a Symfony-only lever.
  • Admin/back-office scaffolding: rapid CRUD screens where devs need "create child from parent detail page" without ceremony — measurable velocity win in internal tooling where security review is lighter.
  • Vendor risk scoring: 28 stars, single-maintainer, narrow scope. Fine as a leaf dependency; do not let architecture depend on it.

When to Consider This Package

Adopt when all of the following hold:

  • The stack is Symfony with Symfony Forms (this bundle will not work in Laravel).
  • You have a recurring need to pass an entity into a form submission as an immutable, non-displayed reference, and the team is already writing that transformer by hand in multiple places.
  • Your controllers/forms validate ownership and existence downstream — a hidden field is client-supplied and tamperable; this package resolves entity-by-ID via a callable, but it does not grant authorization. The callable must scope by tenant/user, and the form must still assert permission.
  • The dependency footprint matters more than long-term maintenance guarantees: small, no runtime service dependencies, MIT-licensed, easy to fork or replace.

Look elsewhere (or write ~30 lines yourself) when:

  • You're on Laravel, using Inertia/Livewire, or working API-first — route model binding and typed request DTOs make hidden entity fields largely unnecessary.
  • The field is security-sensitive: never use a hidden entity reference as the sole mechanism for "which account/record is this." Server-side session or scoped queries are safer.
  • The package is unmaintained relative to your Symfony major version, or your org has a no-low-star-dependencies policy.
  • You need auditability, optimistic concurrency, or entity versioning — you're past a form-type solution.

How to Pitch It (Stakeholders)

For executives: This is a small, free Symfony utility that removes repetitive code for a common form pattern — attaching a parent record (e.g., an order, project, or account) to a form the user fills in. It's a developer-productivity choice, not a product feature; cost is near zero and the risk is low because it's a few-dozen-line helper that can be replaced in a sprint if abandoned. One caveat: it must sit behind existing permission checks, since any hidden form value can be tampered with.

For engineering: It standardizes how we embed entity references in Symfony Forms — a HiddenEntityType that resolves an entity from a submitted identifier via a configured callable. Adopt it if we're writing the same hidden field + data transformer in three or more forms; otherwise write the transformer locally. Requirements: pin the version, verify compatibility with our Symfony LTS, and enforce authorization in the resolver callable (tenant/user scoping) rather than trusting the submitted ID. Note this is Symfony-only — it has no role in our Laravel work and should not inform cross-framework form strategy.

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
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons