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
Nova Belongs To Dependency

Nova Belongs To Dependency Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Extended Laravel Nova BelongsTo field that can depend on other fields (including BelongsTo/Text/Status).

Frequently asked questions about Nova Belongs To Dependency
What is manmohanjit/nova-belongs-to-dependency used for?
It is a Laravel Nova field package that extends the native BelongsTo field so its options can depend on another form field. When a sibling field such as a parent BelongsTo, Text, or Status input changes, the dependent BelongsTo reloads and filters its options, enabling cascading dropdowns like country, state, and city inside Nova resources. It is a presentation-layer concern only and adds no database schema or service provider footprint.
How do I install and use it in a Laravel Nova project?
The documented path is composer require manmohanjit/nova-belongs-to-dependency, publish or compile the package assets, then replace BelongsTo::make() with the package field class on the resources that need cascading selects. In practice, because the repository is archived, the safer route is to copy the field class and Vue component into your own codebase and register them under your namespace. Either way, effort is measured in hours for a proof of concept.
Does it support Laravel Nova 4 or Nova 5?
There is no compatibility guarantee because the repository is archived and Nova's field internals change across major versions. The package extends first-party Nova primitives and a custom Vue component, so it is tightly coupled to the Nova major and minor it was built against. Validate it against your exact Nova version before relying on it, and expect the next Nova upgrade to require patches you will have to write yourself.
How is this different from Nova's native dependsOn() method?
Nova's native dependsOn() only toggles visibility or read-only state on a field; it does not re-query or filter a BelongsTo relationship's option set based on a sibling field's value. This package fills that specific gap by shipping a field class and Vue component that react to sibling field state and reload the option list. That makes it useful for true cascading selects rather than simple show/hide behavior.
Can the dependent field react to Text and Status fields, not just BelongsTo?
Yes. The package is described as depending on other fields including BelongsTo, Text, and Status, so the trigger field does not have to be a relationship select. That flexibility is useful when a status or free-text input should narrow the related records shown. Confirm the exact watcher behavior against the Nova version and field types you plan to use.
Is it safe to use in production?
Treat it as abandoned: the repository is archived, it has a single maintainer, and there is no realistic upstream fix path or security response channel. The code is small enough to audit and vendor, which is the recommended production approach rather than adding a versioned Composer dependency. Once forked, ownership and patching become your responsibility, including compatibility with future Nova releases.
Does the package register any routes or controllers for loading options?
That must be verified by reading the source before adopting it, because cascading option loading often implies an AJAX endpoint. If the package registers its own route, confirm it is gated by a policy or authorization check and that relationship queries are scoped to what the current user may see. A dependent-select endpoint that returns unfiltered relationship data would be a horizontal privilege leak.
How do I make cascading dropdowns work on edit forms with existing values?
Test both create and update flows, including pre-populated edit forms where the parent value is already set when the page loads. The dependent field should initialize with the correct filtered options rather than staying empty until the parent changes. If it does not, you may need to adjust the Vue component's mount behavior in your vendored fork.
What alternatives exist for dependent BelongsTo fields in Laravel Nova?
You can build a small custom field that extends Nova's BelongsTo and ships its own Vue component, which is essentially what this package does. Another option is to vendor this package's field class and component into app/Nova/Fields and resources/js/nova and own the code. Nova's native dependsOn() is not a substitute because it only handles visibility and read-only toggling.
How should I maintain a vendored fork of this package?
Copy the field class and Vue component into your codebase, namespace them to your application, and add a header comment pinning the Nova version they were validated against. Rebuild the compiled assets against your project's Nova build to avoid stale-asset silent failures, and document who owns the fork. Revisit on every Nova upgrade and during security review cycles, since upstream will not provide patches.
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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager