epartment/nova-dependency-container
Laravel Nova package that adds a dependency container for conditionally showing or hiding groups of fields. Use dependsOn() to react to another field's value, keeping forms dynamic and clutter-free without custom JavaScript. Ideal for building cleaner, context-aware Nova forms.
Architecture fit
epartment/nova-dependency-container is a pure Nova-layer package: a container field that wraps child fields and conditionally renders them based on the values of sibling fields. It registers a Vue component and a PHP DependencyContainer field class, with no migrations, no service-provider domain logic, no queue or storage footprint. It composes with Nova's existing fields() builder, so it slots into the resource layer without touching application architecture, domain models, or API surfaces. For a Nova 3 estate, this is a natural fit — it expresses conditional form logic declaratively instead of scattering ->hideWhen()/custom Vue work across resources. The 1.3.3 fix extends that fit to fieldsForIndex and fieldsForDetail, so the same container definition can now be reused across form, index, and detail contexts rather than being confined to forms.
Integration feasibility
composer require epartment/nova-dependency-container plus usage inside fields() is the whole install. Two friction points: (1) Nova is a commercial package and is typically not declared as a hard composer dependency, so CI and local resolution need Nova credentials configured; (2) the package is only as good as the discipline around it — dependency definitions live in PHP resource files, but the enforcement is client-side Vue. Any developer can add it in an afternoon; keeping it coherent across 20 resources is the actual work.
Technical risk
dependsOn() rather than adopted.rules() must be authored separately, and divergence between the visual dependency graph and the server-side rules is the most likely source of bad data.v-if are not submitted; on update this can null out or overwrite previously stored values depending on how the resource's save/fill behaves. This needs explicit testing, not assumption.fieldsForIndex/fieldsForDetail. Any resource that defines dependency containers there should be re-verified on the new version; conversely, teams that had worked around it can drop the workaround.Key questions
dependsOn() cover our requirements (equality-only conditions, single-level nesting), making this package unnecessary?fieldsForIndex/fieldsForDetail, and if so, does 1.3.3 resolve the previous workaround?Stack fit Assumes a Laravel + Nova 3 stack on PHP 7.4/8.x. No database, cache, or infrastructure changes; no impact on API or non-Nova code paths. Deploys with the application.
Migration path
dependsOn() later is a single-file change rather than a sweep across resources.hideWhen/custom Vue conditionals one resource at a time, starting with the highest-change-frequency forms where conditional bugs actually cost support tickets.fieldsForIndex/fieldsForDetail, take 1.3.3 — it is the targeted fix. Remove any local workarounds rather than stacking them on top.Compatibility Pin the package version explicitly; do not float. Verify against the installed Nova release in staging with real resource forms, including a create and an update path, before any rollout. The 1.3.3 fix also means the verification matrix should include index and detail views, not just forms — a gap in the previous plan. Check the compiled asset actually loads on the target Nova build (browser console clean, container renders). If the estate is already on Nova 4+, run the native-feature comparison first and expect to skip this package.
Sequencing
rules() mirrors them, how nullable/hidden values are handled, and which resource methods may use the container.Maintenance Assume ownership. MIT licensing is clean for legal/SCA purposes, and 1.3.3 is welcome evidence that the maintainer responds to issues — but there is still no release cadence to ride. Budget a small, recurring allowance for: patch review on Nova upgrades, potential fork to rebuild the Vue asset for Vue 3, and periodic check that upstream hasn't gone quiet. Put it on the dependency watchlist with an annotation reflecting current reality: "low-activity, single-maintainer, Nova 3-only — fork-and-own intent."
Support No vendor support. Issues are community-only and intermittent. Mitigate with an internal runbook: how the container works, the per-resource dependency graph, the validation-mirroring rule, and known pitfalls — including the pre-1.3.3 index/detail behaviour, so anyone still on an older pin recognises the symptom.
Scaling Runtime cost is negligible — it is client-side rendering on admin forms and index/detail tables, not a request-path concern. Scaling pressure is complexity, not throughput: conditional combinatorics grow faster than field count, and deeply nested containers become hard to reason about and debug. Set a convention ceiling (e.g. one level of nesting, equality conditions only) and push anything beyond it into custom fields or resource splitting.
Failure modes
Ramp-up Low for anyone with Nova experience — measured in hours, since the mental model mirrors Nova's field composition. The real onboarding cost is the internal convention: developers must learn that visibility is cosmetic and validation is their responsibility. Add one paragraph to the resource-development guide and one worked example; that is sufficient for a competent Laravel team.
How can I help you explore Laravel packages today?