manmohanjit/nova-belongs-to-dependency
A Laravel Nova field package that makes BelongsTo relationships depend on another form field. When the parent select changes, the dependent BelongsTo options reload and filter automatically, enabling cascading dropdowns such as country, state, and city inside Nova resources.
Architecture fit
Laravel Nova's native BelongsTo field supports dependsOn() only for visibility/read-only toggling in the form — it does not re-query or filter the relationship options based on a sibling field's value. This package fills that specific gap by extending the field class and shipping a custom Vue component that reacts to sibling field state (BelongsTo, Text, Status) and reloads its option set. Architecturally it is a thin decorator over a first-party Nova primitive, which is the right shape: no service provider hijacking of Nova internals, no database schema footprint, no event/listener surface. It is a presentation-layer concern only, so blast radius is limited to Nova form rendering.
The caveat is that Nova is a closed-source, license-gated product whose field internals (Vue mixin APIs, dependsOn resolution, relatable query hooks) change across major versions. Any package that extends those internals inherits version-coupling risk that is invisible from the outside.
Integration feasibility
Mechanically trivial: composer require manmohanjit/nova-belongs-to-dependency, publish/compile assets, then swap BelongsTo::make() for the package's field on the handful of resources that need cascading selects. Effort is hours, not days, for a proof of concept.
The real feasibility constraint is provenance, not code. Ten stars, a single maintainer, and an archived repository mean there is no realistic path to upstream fixes, no security response channel, and no compatibility guarantee against Nova 4/5. For a TPM, the correct framing is not "adopt a dependency" but "vendor a ~few-hundred-line field component into our codebase and own it." That changes the calculus favorably — the code is small enough to audit and adopt — but it must be a deliberate fork, not a Composer line item.
Technical risk
Key questions before any commitment
Stack fit
Fits cleanly into a standard Laravel + Nova stack with no additional infrastructure: no queue, no cache dependency, no external service. It is additive to the admin panel only; public application code, APIs, and data models are untouched. This keeps the change reversible — reverting is deleting a field class and reverting resource files.
Migration path
Do not install as a versioned Composer dependency. Instead:
app/Nova/Fields/ and resources/js/nova/ (or equivalent), namespaced to us.dependsOn(), field chaining) identical so resource files read naturally and can be migrated back if an upstream replacement emerges.Compatibility
Validate against the specific Nova version first — this is the gating check, not an afterthought. Confirm: field renders on index/detail views or is form-only; dependsOn chains of length >1 resolve correctly; nullable parent values produce an empty-but-valid state rather than an error. Also confirm behavior under Nova's rules() and nullable() constraints, since dependent selects frequently interact badly with validation when the parent changes after the child was set.
Sequencing
Maintenance
Effectively zero upstream maintenance and non-zero internal maintenance. Budget a small but permanent tax: every Nova upgrade requires re-testing the field, and roughly an afternoon of remediation per Nova major. Contrast this with the alternative — a bespoke cascading-select built in-house — which costs more upfront (days) but has no provenance ambiguity and can be designed against the target Nova version rather than reverse-engineered from an abandoned one.
Support
No vendor, no community of scale, no issue tracker that will respond. Support is entirely internal. This is acceptable only because the surface is narrow (form rendering) and the failure mode is visible (broken dropdown) rather than silent (corrupt data). If the cascade ever touched write paths or validation-critical logic, the calculus would change materially.
Scaling
Two scaling vectors matter. First, option-set size: if the dependent field loads hundreds of records per parent change, latency and DB load grow with admin usage, not user traffic — usually tolerable, but worth measuring on the largest relationship (e.g. a child table in the millions). Second, concurrency on edit forms: if two admins edit the same record with dependent selects, there is no additional risk beyond Nova's baseline optimistic behavior, but stale options after a parent change can cause a user to save a now-invalid relationship unless validation re-checks it server-side. Server-side validation must be authoritative; the client cascade is a UX affordance only.
Failure modes
Ramp-up
Low for Laravel/Nova-fluent engineers: the field's public API mirrors BelongsTo, so resource code is self-explanatory and a mid-level developer can use it after reading one example. The ramp-up cost is concentrated in the upgrade path — whoever next touches Nova must understand that this field is a vendored fork, not a package, and that it needs manual re-validation. That knowledge must live in a README, not in someone's head.
Overall verdict: technically sound for a narrow problem, but the archived status and single-maintainer risk make it inappropriate as a live dependency. Forking the small codebase, guarding any custom endpoint, and scoping rollout to one or two admin resources yields most of the value at acceptable lifetime cost. Do not adopt it anywhere the cascade is load-bearing for data integrity.
How can I help you explore Laravel packages today?