PHPackages                             parfumix/nova-creatable-belongs-to - 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. [API Development](/categories/api)
4. /
5. parfumix/nova-creatable-belongs-to

ActiveLibrary[API Development](/categories/api)

parfumix/nova-creatable-belongs-to
==================================

BelongsTo field for laravel nova which allows to choose or create a resource

1.0.3(7y ago)06MITVuePHP &gt;=7.1.0

Since Jan 3Pushed 6y agoCompare

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

READMEChangelogDependencies (1)Versions (10)Used By (0)

Creatable BelongsTo Field for Laravel Nova
==========================================

[](#creatable-belongsto-field-for-laravel-nova)

BelongsTo Field for [Laravel Nova](https://nova.laravel.com) which allows to choose or create a resource

[![Latest Stable Version](https://camo.githubusercontent.com/f5a0ce62e8e600ae4ebab9d267e937637a23d18f0fe9a414a51990f72a192644/68747470733a2f2f706f7365722e707567782e6f72672f73706172636c65782f6e6f76612d637265617461626c652d62656c6f6e67732d746f2f762f737461626c65)](https://packagist.org/packages/sparclex/nova-creatable-belongs-to)[![Total Downloads](https://camo.githubusercontent.com/b9b68dd1f5bf18bfdaafe17504e6dae8774603c374e06654c4f34ab54acd84c6/68747470733a2f2f706f7365722e707567782e6f72672f73706172636c65782f6e6f76612d637265617461626c652d62656c6f6e67732d746f2f646f776e6c6f616473)](https://packagist.org/packages/sparclex/nova-creatable-belongs-to)[![Latest Unstable Version](https://camo.githubusercontent.com/e9e9d19c4c4435631ad411aafc2a418e661ba8042a8afcc5a8149d027ea903b2/68747470733a2f2f706f7365722e707567782e6f72672f73706172636c65782f6e6f76612d637265617461626c652d62656c6f6e67732d746f2f762f756e737461626c65)](https://packagist.org/packages/sparclex/nova-creatable-belongs-to)[![License](https://camo.githubusercontent.com/b703d34880c4b581fa0d12e061d30900abf7095e546592092ade54fc08ed7f37/68747470733a2f2f706f7365722e707567782e6f72672f73706172636c65782f6e6f76612d637265617461626c652d62656c6f6e67732d746f2f6c6963656e7365)](https://packagist.org/packages/sparclex/nova-creatable-belongs-to)[![StyleCI](https://camo.githubusercontent.com/2fb04a03edd00a1bb3eb54fb62835c4d38a0147bb26d932acb7e8d564039982c/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136333937363438302f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/163976480)

Use Case
--------

[](#use-case)

Ever had the following database structure and did not want the user to create the related resource (product\_types) seperatly since it only consists of a unique name. But you don't want to put the product\_type directly in the products table, since it would violate the third normal form.

[![Database setup example](https://github.com/Sparclex/screenshots/raw/master/nova-creatable-belongs-to-database.png)](https://github.com/Sparclex/screenshots/blob/master/nova-creatable-belongs-to-database.png)

This package solves this, by keeping the original belongsTo field but allowing the user to create a new resource by simply entering a not yet existing name. Additionally it includes the [prepopulate-searchable](https://github.com/alexbowers/nova-prepopulate-searchable) package from alexbowers.

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

[](#installation)

```
composer require sparclex/nova-creatable-belongs-to

```

Add field inside your fields Array. The parameters consist of the same ones as the laravel nova [belongsTo field](https://nova.laravel.com/docs/1.0/resources/relationships.html#belongsto) with an additional `nameAttribute` which determines the name of the display attribute in the related model (default: name).

```
public function fields(Request $request)
{
    return [
        ID::make()->sortable(),
        CreatableBelongsTo::make('ProductType', 'productType', 'App\Nova\ProductType', 'name')
            ->prepopulate()
    ];
}
```

TODO
----

[](#todo)

- Tests
- Respect policies for creation

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 88% 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 ~9 days

Recently: every ~2 days

Total

9

Last Release

2611d ago

Major Versions

v0.0.3 → v1.0.02019-03-08

v0.x-dev → v1.0.22019-03-13

### Community

Maintainers

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

---

Top Contributors

[![Sparclex](https://avatars.githubusercontent.com/u/2805213?v=4)](https://github.com/Sparclex "Sparclex (22 commits)")[![parfumix](https://avatars.githubusercontent.com/u/6368534?v=4)](https://github.com/parfumix "parfumix (3 commits)")

---

Tags

laravelnova

### Embed Badge

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

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

###  Alternatives

[hammerstone/refine-nova

A Laravel Nova integration for the Refine query builder.

3356.5k](/packages/hammerstone-refine-nova)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[coreproc/nova-echo

Adds Laravel Echo with your broadcast configuration to your Laravel Nova app

1996.9k2](/packages/coreproc-nova-echo)

PHPackages © 2026

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