sanderbaas/laravel-nova-belongsto-dependency
A Laravel Nova field that makes BelongsTo selects depend on another field's value, enabling cascading dropdowns in Nova resources. Pick a parent option and the dependent BelongsTo field updates its available options to match.
Architecture fit
BelongsTo field type (PHP field class + compiled Vue component) that makes a searchable relationship select react to the values of sibling fields. There are no migrations, no model changes, and no service-provider-level bindings that would leak into the domain layer.options() closures or custom Vue fields, so a drop-in field is attractive.Integration feasibility
composer require, register the field in a Resource's fields() method, swap out the existing BelongsTo. A developer can spike this in under a day.composer.json constraint on laravel/nova and whether it ships compiled assets or requires a local npm run dev/npm run prod in vendor/.Technical risk
dependsOn() plus closure-based options(), which covers many of these use cases without third-party code. Confirm the package adds behavior the native API cannot express before taking on the dependency.Key questions
composer.json constraint? Does it work on our pinned Nova version and PHP/Laravel version?vendor:publish?relatable(), viaResource(), withMeta(), and Nova's native dependsOn()?Stack fit
composer.json or a vendored fork under our own namespace.Migration path
BelongsTo fields.dependsOn() + options(fn ($request) => Model::where(...)->get()) in Nova 4+, or a small in-house Vue field. The fallback should be scoped and estimated before the spike concludes, so the decision is "adopt vs. build" rather than "adopt or stall."Compatibility
composer.json and freeze it for the duration of the evaluation. Nova upgrades are the primary breakage vector; a minor Nova bump should trigger a regression test of this field.Sequencing
Rule::exists/scoped where rules regardless of package outcome — the field only constrains the UI.Maintenance
Support
Scaling
Failure modes
Recommendation
How can I help you explore Laravel packages today?