PHPackages                             sparclex/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. sparclex/nova-creatable-belongs-to

ActiveLibrary

sparclex/nova-creatable-belongs-to
==================================

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

1.0.3(7y ago)141.9k10[2 issues](https://github.com/Sparclex/nova-creatable-belongs-to/issues)MITVuePHP &gt;=7.1.0

Since Jan 3Pushed 6y ago3 watchersCompare

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

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

32

—

LowBetter than 72% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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/dc57b3c5101444e467ab15d46bbcf84663f496454fdbc77aa98687e95ee92364?d=identicon)[sparclex](/maintainers/sparclex)

---

Top Contributors

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

---

Tags

laravelnova

### Embed Badge

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

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

###  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)[laravel/nova-log-viewer

A Laravel Nova tool for viewing your application logs.

136301.3k1](/packages/laravel-nova-log-viewer)[stepanenko3/nova-command-runner

Laravel Nova tool for running Artisan and bash(shell) commands.

36983.0k](/packages/stepanenko3-nova-command-runner)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[dniccum/nova-documentation

A Laravel Nova tool that allows you to add markdown-based documentation to your administrator's dashboard.

37116.4k](/packages/dniccum-nova-documentation)

PHPackages © 2026

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