PHPackages                             webparking/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. webparking/nova-belongs-to-dependency

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

webparking/nova-belongs-to-dependency
=====================================

Extended Laravel Nova BelongsTo field that can depend on other fields

2.0.1(3y ago)1157.8k↑71.7%13[2 issues](https://github.com/webparking/nova-belongs-to-dependency/issues)MITVuePHP ^7.3|^8

Since Aug 31Pushed 3y agoCompare

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

READMEChangelog (5)Dependencies (1)Versions (6)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.

Originally created by manmohanjit, the original package was abandoned.

Requirements
------------

[](#requirements)

- PHP 7.3+
- Nova 4

Use the 1.x versions if you need support for Nova 3

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

[](#installation)

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

```
composer require webparking/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 Webparking\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 Webparking\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 Webparking\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

34

—

LowBetter than 77% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~224 days

Total

5

Last Release

1189d ago

Major Versions

1.0.2 → v2.0.02022-05-28

PHP version history (2 changes)1.0.0PHP &gt;=7.1.0

v2.0.0PHP ^7.3|^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/4fe108da8fc712dbbc021b6810bdb8f63c0cd373fec8c666b19d2a320c1db65d?d=identicon)[remkobrenters](/maintainers/remkobrenters)

---

Top Contributors

[![manmohanjit](https://avatars.githubusercontent.com/u/7972390?v=4)](https://github.com/manmohanjit "manmohanjit (13 commits)")[![ali-raza-saleem](https://avatars.githubusercontent.com/u/88083032?v=4)](https://github.com/ali-raza-saleem "ali-raza-saleem (8 commits)")[![RVxLab](https://avatars.githubusercontent.com/u/46111684?v=4)](https://github.com/RVxLab "RVxLab (7 commits)")[![dgerrese](https://avatars.githubusercontent.com/u/14330640?v=4)](https://github.com/dgerrese "dgerrese (4 commits)")[![joserick](https://avatars.githubusercontent.com/u/15143699?v=4)](https://github.com/joserick "joserick (3 commits)")[![matteobreschig](https://avatars.githubusercontent.com/u/69394134?v=4)](https://github.com/matteobreschig "matteobreschig (1 commits)")[![muhammadsaeedparacha](https://avatars.githubusercontent.com/u/2680384?v=4)](https://github.com/muhammadsaeedparacha "muhammadsaeedparacha (1 commits)")[![alberto-bottarini](https://avatars.githubusercontent.com/u/1442934?v=4)](https://github.com/alberto-bottarini "alberto-bottarini (1 commits)")

---

Tags

laravelnova

### Embed Badge

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

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

###  Alternatives

[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2872.1M6](/packages/optimistdigital-nova-sortable)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2861.8M9](/packages/outl1ne-nova-sortable)[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)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

14720.0k](/packages/markwalet-nova-modal-response)

PHPackages © 2026

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