PHPackages                             joonas1234/nova-nested-form - 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. joonas1234/nova-nested-form

Abandoned → [yassi/nova-nested-form](/?search=yassi%2Fnova-nested-form)ArchivedLibrary[Admin Panels](/categories/admin)

joonas1234/nova-nested-form
===========================

A Laravel Nova package that allows you to create/update/delete nested related fields from a parent form.

v1.0.0(6y ago)0551MITPHPPHP &gt;=7.1.0

Since Aug 23Pushed 6y ago1 watchersCompare

[ Source](https://github.com/joonas1234/laravel-nova-nested-form)[ Packagist](https://packagist.org/packages/joonas1234/nova-nested-form)[ RSS](/packages/joonas1234-nova-nested-form/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/1eae61ccdaa046f9d308f8c2f4424534f594cf7eee1538b3116410896bd5c955/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6f6e6173313233342f6e6f76612d6e65737465642d666f726d2f762f737461626c65)](https://packagist.org/packages/joonas1234/nova-nested-form)[![Total Downloads](https://camo.githubusercontent.com/80172dea23abed90325745b5535d591f075de68e891aff55576b09bec4d0a48f/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6f6e6173313233342f6e6f76612d6e65737465642d666f726d2f646f776e6c6f616473)](https://packagist.org/packages/joonas1234/nova-nested-form)[![Latest Unstable Version](https://camo.githubusercontent.com/ae41c0714fdde6bf84a117ee695d6b3a2f0ec7f008603de52ce65583426ccebe/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6f6e6173313233342f6e6f76612d6e65737465642d666f726d2f762f756e737461626c65)](https://packagist.org/packages/joonas1234/nova-nested-form)[![License](https://camo.githubusercontent.com/57c74e4d4a476c918808a6eb06c76e3da45d387ed476dbfdc5db8baaeadb74c4/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6f6e6173313233342f6e6f76612d6e65737465642d666f726d2f6c6963656e7365)](https://packagist.org/packages/joonas1234/nova-nested-form)[![Monthly Downloads](https://camo.githubusercontent.com/af5429be334d1a915e69860f71a26c8ec075b5472275d0eb795fe4f647ac25c3/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6f6e6173313233342f6e6f76612d6e65737465642d666f726d2f642f6d6f6e74686c79)](https://packagist.org/packages/joonas1234/nova-nested-form)[![Daily Downloads](https://camo.githubusercontent.com/3b5361abe54d1a59767af2acee27f4c36f14c84e87ae61d21f6397b018e65702/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6f6e6173313233342f6e6f76612d6e65737465642d666f726d2f642f6461696c79)](https://packagist.org/packages/joonas1234/nova-nested-form)

HOX!!
=====

[](#hox)

This package is a clone from . All the credit goes to yassipad. I only applied this pull request to fix bug in newer Nova: [yassilah/laravel-nova-nested-form#68](https://github.com/yassilah/laravel-nova-nested-form/pull/68)

Nova Nested Form
================

[](#nova-nested-form)

This package allows you to include your nested relationships' forms into a parent form.

Release note for 2.0.5
======================

[](#release-note-for-205)

- Max number of children
- Min number of children
- Set default open/collapse behavior
- Set heading template
- Set separator
- No need for trait anymore
- Auto detection of parent ID field
- Catching UpdatedSinceLastRetrieval exception (even for children)
- AfterFillCallback
- BeforeFillCallback
- Updated design for empty relationship
- Handle file uploads
- **COMING** Conditional nested forms
- **COMING** Updated design for single field nested form

Important changes since 1.0.4
=============================

[](#important-changes-since-104)

To be more consistent with Nova's other fields, the order of the parameters has changed to become:

```
NestedForm::make($name, $viaRelationship = null, $class = null),
```

For instance, this:

```
NestedForm::make('Posts'),
```

Is now the same as:

```
NestedForm::make('Posts', 'posts', Post::class),
```

Also, translations are now available in your nested field! You just need to add this key in you language file:

```
"Add a new :resourceSingularName": "Ajouter un(e) :resourceSingularName"
```

Installation
============

[](#installation)

```
composer require joonas1234/nova-nested-form
```

Attach a new relationship form to a resource
============================================

[](#attach-a-new-relationship-form-to-a-resource)

Simply add a NestedForm into your fields. The first parameter must be an existing NovaResource class and the second parameter (optional) must be an existing HasOneOrMany relationship in your model.

```
namespace App\Nova;

use Laravel\Nova\Fields\ID;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Gravatar;
use Laravel\Nova\Fields\Password;
// Add use statement here.
use Joonas1234\NestedForm\NestedForm;

class User extends Resource
{
    ...
    public function fields(Request $request)
    {
        return [
            ID::make()->sortable(),

            Gravatar::make(),

            Text::make('Name')
                ->sortable()
                ->rules('required', 'max:255'),

            Text::make('Email')
                ->sortable()
                ->rules('required', 'email', 'max:254')
                ->creationRules('unique:users,email')
                ->updateRules('unique:users,email,{{resourceId}}'),

            Password::make('Password')
                ->onlyOnForms()
                ->creationRules('required', 'string', 'min:6')
                ->updateRules('nullable', 'string', 'min:6'),

            // Add NestedForm here.
            NestedForm::make('Posts'),
        ];
    }
```

You can also nest your relationship forms by adding another NestedForm into the fields of your App\\Nova\\Post.

NEW: Add a callback before and/or after your relationships have been updated
============================================================================

[](#new-add-a-callback-before-andor-after-your-relationships-have-been-updated)

For instance, if you have to modify a value on the request before the nested form is filled or trigger an event after all relations have been set, you can now simply use this:

```
NestedForm::make('Posts')
->beforeFill(function ($request, $model, $attribute, $requestAttribute) {
    $request->merge(['key' => 'value']);
    // or
    if (!$model->hasSomeProperty) {
        throw new \Exception('You cannot do this.');
    }
})
->afterFill(function ($request, $model, $attribute, $requestAttribute, $touched) {
    $touched->each(function ($model) {
        if ($model->wasRecentlyCreated) {
            // do something
        }
    });
})
```

Add a minimum or a maximum number of children
=============================================

[](#add-a-minimum-or-a-maximum-number-of-children)

For instance, if you want every user to have at least 3 posts and at most 5 posts, simply use:

```
NestedForm::make('Posts')->min(3)->max(5),
```

When creating a new user, 3 blank posts will be displayed. If you reach the maximum number of posts, the "Add a new post" button will disappear.

Set the default open/collapse behavior
======================================

[](#set-the-default-opencollapse-behavior)

If you want the nested forms to be opened by default, simply use:

```
NestedForm::make('Posts')->open(true),
```

You can also decide to open only the first nested form by using:

```
NestedForm::make('Posts')->open('only first'),
```

Modify the default heading
==========================

[](#modify-the-default-heading)

You can modify the default heading using the heading() method. You can use wildcards to add dynamic content to your label such as '{{id}}', '{{index}}' or any attribute present in the form.

```
NestedForm::make('Posts')->heading('{{index}} // Post - {{title}}'),
```

Modify the index separator
==========================

[](#modify-the-index-separator)

You can modify the default index separator using the separator() method when you have nested forms (e.g. 1. Post, 1.1. Comment, 1.1.1. Like).

```
NestedForm::make('Posts')->separator('\'),

```

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

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

2502d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d125683f947bfd8351c10a03ff008c4b2aea9e5272e11c66634e86ce6ff38fe?d=identicon)[joonas1234](/maintainers/joonas1234)

---

Top Contributors

[![joonas1234](https://avatars.githubusercontent.com/u/35030215?v=4)](https://github.com/joonas1234 "joonas1234 (4 commits)")[![s-sadiq](https://avatars.githubusercontent.com/u/3797475?v=4)](https://github.com/s-sadiq "s-sadiq (1 commits)")

---

Tags

laravelnestedformnovarelationship

### Embed Badge

![Health badge](/badges/joonas1234-nova-nested-form/health.svg)

```
[![Health](https://phpackages.com/badges/joonas1234-nova-nested-form/health.svg)](https://phpackages.com/packages/joonas1234-nova-nested-form)
```

###  Alternatives

[yassi/nova-nested-form

A Laravel Nova package that allows you to create/update/delete nested related fields from a parent form.

239505.2k](/packages/yassi-nova-nested-form)[handleglobal/nova-nested-form

A Laravel Nova package that allows you to create/update/delete nested related fields from a parent form.

381.9k](/packages/handleglobal-nova-nested-form)[khalin/nova-link-field

A Laravel Nova Link field.

31576.5k2](/packages/khalin-nova-link-field)[printnow/laravel-admin

Dcat admin 永久分叉版 / 支持 Laravel 10-13, PHP 版本限制 &gt;= 8.1（支持 PHP 8.5）

452.4k](/packages/printnow-laravel-admin)

PHPackages © 2026

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