PHPackages                             mabou7agar/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. [Admin Panels](/categories/admin)
4. /
5. mabou7agar/nova-belongs-to-dependency

ActiveLibrary[Admin Panels](/categories/admin)

mabou7agar/nova-belongs-to-dependency
=====================================

Extended Laravel Nova BelongsTo field that can depend on other fields

1.0.0(5y ago)00MITVuePHP &gt;=7.1.0

Since Aug 31Pushed 5y agoCompare

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

READMEChangelogDependencies (1)Versions (4)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.

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

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61.9% 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

Unknown

Total

1

Last Release

2134d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/910aa2861357099f7cf10e3991b5108b93e4518cc34e2e8348d708578af1ccc0?d=identicon)[mabou7agar](/maintainers/mabou7agar)

---

Top Contributors

[![manmohanjit](https://avatars.githubusercontent.com/u/7972390?v=4)](https://github.com/manmohanjit "manmohanjit (13 commits)")[![mabou7agar](https://avatars.githubusercontent.com/u/13303169?v=4)](https://github.com/mabou7agar "mabou7agar (4 commits)")[![RVxLab](https://avatars.githubusercontent.com/u/46111684?v=4)](https://github.com/RVxLab "RVxLab (3 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/mabou7agar-nova-belongs-to-dependency/health.svg)

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

###  Alternatives

[whitecube/nova-page

Static pages content management for Laravel Nova

23997.1k1](/packages/whitecube-nova-page)[optimistdigital/nova-page-manager

Page(s) and region(s) manager for Laravel Nova.

17989.5k](/packages/optimistdigital-nova-page-manager)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[optimistdigital/nova-table-field

Table field for Laravel Nova

40132.7k](/packages/optimistdigital-nova-table-field)[outl1ne/nova-table-field

Table field for Laravel Nova

4070.5k](/packages/outl1ne-nova-table-field)[khalin/nova-link-field

A Laravel Nova Link field.

31587.5k2](/packages/khalin-nova-link-field)

PHPackages © 2026

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