PHPackages                             delphi64x/nova-belongs-to-dependency - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. delphi64x/nova-belongs-to-dependency

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

delphi64x/nova-belongs-to-dependency
====================================

Extended Laravel Nova BelongsTo field that can depend on other fields

1.1.2(6y ago)069MITPHPPHP &gt;=7.1.0

Since Jan 12Pushed 6y agoCompare

[ Source](https://github.com/delphi64x/nova-belongs-to-dependency)[ Packagist](https://packagist.org/packages/delphi64x/nova-belongs-to-dependency)[ RSS](/packages/delphi64x-nova-belongs-to-dependency/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)DependenciesVersions (5)Used By (0)

BelongsTo field with dependency support for Nova
================================================

[](#belongsto-field-with-dependency-support-for-nova)

This package is an extension of Laravel Nova's existing BelongsTo field and Vue components.

Installation
------------

[](#installation)

You can install this package on a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require manmohanjit/nova-belongs-to-dependency
```

Usage
-----

[](#usage)

The following will list categories with `type_id` equal to the value set in the first BelongsTo field.

```
use Manmohanjit\BelongsToDependency\BelongsToDependency;
...
return [
    ...
    BelongsTo::make('Type'),

    BelongsToDependency::make('User')
        ->dependsOn('type', 'type_id'),
    ...
];
```

Look at the [example](#example) below for other use cases.

Example
-------

[](#example)

Database Structure

- Type (id, name)
- Posts (id, type\_id, category\_id, title, body)
- Category (id, type\_id, title)

We should only be able to assign categories to posts that belong to the same type.

This is how you would achieve it on the Nova category resource:

```
use Manmohanjit\BelongsToDependency\BelongsToDependency;
...
return [
    ...
    BelongsTo::make('Type'),

    BelongsToDependency::make('User')
        ->dependsOn('type', 'type_id'),
    ...
];
```

This would work if you used a text/enum `type` field too.

```
use Manmohanjit\BelongsToDependency\BelongsToDependency;
...
return [
    ...
    Select::make('Type')->options([
        'post' => 'Post',
        'page' => 'Page',
    ])>displayUsingLabels(),

    BelongsToDependency::make('User')
        ->dependsOn('type', 'type'),
    ...
];
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [nova-belongsto-depend](https://github.com/orlyapps/nova-belongsto-depend) (alternative)
- [nova-dependency-container](https://github.com/epartment/nova-dependency-container)

This tool extends the base Laravel Nova BelongsTo field and is inspired by Nova Dependency Container.

License
-------

[](#license)

The MIT License (MIT). Please see License File for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~58 days

Total

4

Last Release

2504d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f4099f2c0bf826e40f96f99978e5357e2597f91ad7f304d23eaea00d4f80e168?d=identicon)[tobject](/maintainers/tobject)

---

Top Contributors

[![manmohanjit](https://avatars.githubusercontent.com/u/7972390?v=4)](https://github.com/manmohanjit "manmohanjit (12 commits)")[![tobject-dev](https://avatars.githubusercontent.com/u/215984702?v=4)](https://github.com/tobject-dev "tobject-dev (5 commits)")

---

Tags

laravelnova

### Embed Badge

![Health badge](/badges/delphi64x-nova-belongs-to-dependency/health.svg)

```
[![Health](https://phpackages.com/badges/delphi64x-nova-belongs-to-dependency/health.svg)](https://phpackages.com/packages/delphi64x-nova-belongs-to-dependency)
```

###  Alternatives

[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[digital-creative/conditional-container

Provides an easy way to conditionally show and hide fields in your Nova resources.

116593.8k4](/packages/digital-creative-conditional-container)[genealabs/laravel-overridable-model

Provide a uniform method of allowing models to be overridden in Laravel.

92398.0k2](/packages/genealabs-laravel-overridable-model)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

51174.8k1](/packages/inspheric-nova-defaultable)[murdercode/nova4-tinymce-editor

Boost your Laravel Nova with the TinyMCE editor.

17165.2k](/packages/murdercode-nova4-tinymce-editor)[yieldstudio/nova-google-autocomplete

A Laravel Nova Google autocomplete field.

12218.4k](/packages/yieldstudio-nova-google-autocomplete)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
