- What does orlyapps/nova-belongsto-depend do?
- It adds a dependent BelongsTo field type to Laravel Nova. When a developer picks a parent option, the child select reloads over AJAX so related records stay filtered to that parent. Typical uses are country to state, client to project, or category to subcategory in Nova admin forms.
- How do I install nova-belongsto-depend in Laravel Nova?
- Install it with composer require orlyapps/nova-belongsto-depend. Nova auto-discovery registers the field, so there is no config to publish and no service provider to register manually. You still need valid Nova Composer credentials configured in every environment, including CI and staging.
- Which Laravel Nova versions does this package support?
- The last release was 2022-06-21, which places it at the Nova 3 to Nova 4 boundary where the frontend moved from Vue 2 to Vue 3. Nova 5 support is unverified. Pin the exact package version and the Nova minor in composer.lock, and add an explicit laravel/nova constraint so an upgrade cannot silently drag the field onto an unsupported runtime.
- Does nova-belongsto-depend require database migrations or config publishing?
- No. The package ships a PHP BelongsTo subclass, a precompiled Vue asset, and a small vendor route; it owns no schema, migrations, or business workflow. Installation is composer require plus Nova auto-discovery, with no database changes.
- Does the dependent BelongsTo field work on edit forms as well as create forms?
- That is not confirmed in the available documentation and should be treated as a spike exit criterion. On edit forms the parent resolution order differs from create, so the child select may not populate correctly for existing records. Test both new entry and editing an existing record before scoping a trial.
- Is the AJAX filtering server-side or does it fetch all options in JavaScript?
- This is undocumented and should be verified early. If filtering is a constrained server-side query, the field is fine; if it fetches all rows and filters in JavaScript, treat it as a data-correctness hazard on large lookup tables. Do not adopt until you have confirmed which approach the vendor route uses.
- Is orlyapps/nova-belongsto-depend still maintained?
- It has one maintainer, zero dependents, and a last release dated 2022-06-21. The PHP is auditable in an afternoon, but the frontend ships as a compiled Vue asset with no build chain, so the JavaScript is not cheap to patch. The realistic failure mode is silent UI breakage after a Nova upgrade, not a security compromise.
- Can I replace nova-belongsto-depend with Nova's native dependsOn()?
- Likely yes, and this is the build-versus-buy question to answer in a spike. Nova's native dependsOn() combined with a relatable() closure can probably reach parity in roughly 100 owned lines. Because reimplementation is cheap, the package's value is convenience, which caps how much upgrade risk is rational to accept.
- Do I need Nova Composer credentials in CI and staging to install this?
- Yes. Nova is commercial, so its Composer credentials must be present in every environment that runs composer install, including CI, staging, and new developer laptops. This is usually the first blocker, so confirm it before writing the ticket.
- How do I remove or roll back nova-belongsto-depend?
- Rollback is a field class swap plus dependency removal: revert the field to a plain Nova BelongsTo and run composer remove orlyapps/nova-belongsto-depend. There is no persisted state, backfill, or schema coupling, so the exit cost per field is negligible.