PHPackages                             stepanenko3/nova-json - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. stepanenko3/nova-json

ActivePackage[Parsing &amp; Serialization](/categories/parsing)

stepanenko3/nova-json
=====================

Nova json field to spread a json column throughout multiple fields.

v4.1.3(1y ago)42269.5k↓27.1%13[9 issues](https://github.com/stepanenko3/nova-json/issues)[2 PRs](https://github.com/stepanenko3/nova-json/pulls)MITVuePHP &gt;=8.0

Since May 11Pushed 1y ago2 watchersCompare

[ Source](https://github.com/stepanenko3/nova-json)[ Packagist](https://packagist.org/packages/stepanenko3/nova-json)[ RSS](/packages/stepanenko3-nova-json/feed)WikiDiscussions main Synced 1w ago

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

Nova JSON Field
===============

[](#nova-json-field)

[![Latest Version on Packagist](https://camo.githubusercontent.com/06def9caa69dc29a6ef93d74e7cc6145cddaf09551e5607efda5400042540c5f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746570616e656e6b6f332f6e6f76612d6a736f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stepanenko3/nova-json)[![Total Downloads](https://camo.githubusercontent.com/7a6e8f0c331cd4b0f445704be9b2d17b93558419f06b6f2de342e401b14428ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73746570616e656e6b6f332f6e6f76612d6a736f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stepanenko3/nova-json)[![License](https://camo.githubusercontent.com/68e2461b8c00168a05b53f4febf78cd06ccaaa9d9583d45b453b62940ab04d23/68747470733a2f2f706f7365722e707567782e6f72672f73746570616e656e6b6f332f6e6f76612d6a736f6e2f6c6963656e7365)](https://packagist.org/packages/stepanenko3/nova-json)

[![screenshot of field](screenshots/field.png)](screenshots/field.png)

Description
-----------

[](#description)

The `JSON` field wrapper allows you to specify multiple fields which will be resolved into a single model attribute. This allows you to validate every information you store inside a json column seperately.

Features
--------

[](#features)

- Fields for JSON keys
- Array of fields
- Repeatable field groups
- Works with Tabs

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

[](#requirements)

- `php: >=8.0`
- `laravel/nova: ^4.0`

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

[](#installation)

```
# Install the package
composer require stepanenko3/nova-json
```

Usage
-----

[](#usage)

```
use Stepanenko3\NovaJson\Fields\JsonArray;
use Stepanenko3\NovaJson\Fields\JsonRepeatable;
...

JsonArray::make('Mails', 'mails->main')
    ->fullWidth()
    ->rules([
        'required',
        'array',
        'between:1,10',
    ])
    ->field(
        field: Email::make('Email', 'value')
            ->fullWidth()
            ->rules([
                'required',
                'email:rfc,dns',
            ]),
    ),

JsonRepeatable::make('Mails For Countries', 'mails->countries')
    ->fullWidth()
    ->rules([
        'required',
        'array',
        'between:1,10',
    ])
    ->fields([
        Country::make('Country', 'country')
            ->fullWidth()
            ->rules([
                'required',
            ]),

        JsonArray::make('Mails', 'mails')
            ->fullWidth()
            ->rules([
                'required',
                'array',
                'between:1,10',
            ])
            ->field(
                field: Email::make('Email', 'value')
                    ->fullWidth()
                    ->rules([
                        'required',
                        'email:rfc,dns',
                    ]),
            ),
    ]),
```

The Big Example
---------------

[](#the-big-example)

```
use Stepanenko3\NovaJson\Fields\JsonArray;
use Stepanenko3\NovaJson\Fields\JsonRepeatable;
...

new Tabs('JSON', [
    'Address' => [
        Text::make('Country', 'settings->address->country')
            ->rules([
                'required',
            ]),

        Text::make('City', 'settings->address->city')
            ->readonly()
            ->rules([
                'required',
            ])
            ->dependsOn(
                attributes: ['settings->address->country'],
                mixin: function (Text $field, NovaRequest $request, FormData $formData) {
                    if ($formData->{'settings->address->country'}) {
                        $field->readonly(false);
                    }
                },
            ),

        Text::make('Street', 'settings->address->street')
            ->readonly()
            ->rules([
                'required',
            ])
            ->dependsOn(
                attributes: ['settings->address->city'],
                mixin: function (Text $field, NovaRequest $request, FormData $formData) {
                    if ($formData->{'settings->address->city'}) {
                        $field->readonly(false);
                    }
                },
            ),

        Heading::make('Location'),

        Text::make('Latitude', 'settings->address->location->latitude')
            ->readonly()
            ->rules([
                'required',
            ])
            ->dependsOn(
                attributes: ['settings->address->city'],
                mixin: function (Text $field, NovaRequest $request, FormData $formData) {
                    if ($formData->{'settings->address->city'}) {
                        $field->readonly(false);
                    }
                },
            ),

        Text::make('Longitude', 'settings->address->location->longitude')
            ->readonly()
            ->rules([
                'required',
            ])
            ->dependsOn(
                attributes: ['settings->address->city'],
                mixin: function (Text $field, NovaRequest $request, FormData $formData) {
                    if ($formData->{'settings->address->city'}) {
                        $field->readonly(false);
                    }
                },
            ),
    ],
    'Brand' => [
        Color::make('Primary Color', 'settings->brand->colors->primary')
            ->rules([
                'required',
            ]),

        Color::make('Secondary Color', 'settings->brand->colors->secondary')
            ->rules([
                'required',
            ]),
    ],
    'Links' => [
        Text::make('Website', 'settings->links->website')
            ->rules(['required', 'string', 'nullable', 'min:3', 'url']),

        Text::make('iOS', 'settings->links->ios')
            ->rules(['string', 'nullable', 'min:3', 'url']),

        Text::make('Android', 'settings->links->android')
            ->rules(['string', 'nullable', 'min:3', 'url']),
    ],
    'Mailing' => [
        JsonArray::make('Mails', 'settings->mails->main')
            ->fullWidth()
            ->rules([
                'required',
                'array',
                'between:1,10',
            ])
            ->field(
                field: Email::make('Email', 'value')
                    ->fullWidth()
                    ->rules([
                        'required',
                        'email:rfc,dns',
                    ]),
            ),

        JsonRepeatable::make('Mails For Countries', 'settings->mails->countries')
            ->fullWidth()
            ->rules([
                // 'required',
                'array',
                'between:1,10',
            ])
            ->fields([
                Country::make('Country', 'country')
                    ->fullWidth()
                    ->rules([
                        'required',
                    ]),

                JsonArray::make('Mails', 'mails')
                    ->fullWidth()
                    ->rules([
                        'required',
                        'array',
                        'between:1,10',
                    ])
                    ->field(
                        field: Email::make('Email', 'value')
                            ->fullWidth()
                            ->rules([
                                'required',
                                'email:rfc,dns',
                            ]),
                    ),
            ]),
    ],
    'Tiles' => [
        JsonRepeatable::make('Tiles', 'settings->tiles')
            ->fullWidth()
            ->stacked()
            ->rules([
                'required',
                'array',
                'between:2,1000',
            ])
            ->fields([
                Number::make('count', 'count')
                    ->fullWidth()
                    ->rules([
                        'required',
                        'numeric',
                        'between:0,100',
                    ]),

                Number::make('height', 'height')
                    ->fullWidth()
                    ->step(0.01)
                    ->rules([
                        'required',
                        'numeric',
                        'between:0,100',
                    ]),

                BooleanGroup::make('Settings', 'settings')
                    ->fullWidth()
                    ->options([
                        'display' => 'Display',
                        'primary' => 'Primary',
                    ]),
            ]),
    ],
    'Demo' => [
        JsonRepeatable::make('Layouts', 'settings->layouts')
            ->fullWidth()
            ->stacked()
            ->rules([
                'required',
                'array',
                'max:3',
            ])
            ->fields([
                Currency::make('Currency', 'value1')
                    ->fullWidth()
                    ->rules(['required', 'in:100,200,300,400,500']),

                Currency::make('Currency 2', 'value2')
                    ->fullWidth()
                    ->rules(['required', 'in:100,200,300,400,500']),

                BooleanGroup::make('Demo', 'demo')
                    ->fullWidth()
                    ->options([
                        'demo' => 'Demo',
                        'demo2' => 'Demo2',
                    ]),

                Markdown::make('Demo2', 'demo2')
                    ->fullWidth(),

                JsonArray::make('Demo3', 'demo3')
                    ->fullWidth()
                    ->field(
                        field: Text::make('Value', 'value')
                            ->fullWidth(),
                    ),

                JsonArray::make('Demo4', 'demo4')
                    ->fullWidth()
                    ->field(
                        JsonRepeatable::make('Value', 'value')
                            ->fullWidth()
                            ->rules([
                                'required',
                                'array',
                                'max:3',
                            ])
                            ->fields([
                                Currency::make('Currency', 'value1')
                                    ->fullWidth()->rules(['required', 'in:100,200,300,400,500']),

                                Currency::make('Currency 2', 'value2')
                                    ->fullWidth()->rules(['required', 'in:100,200,300,400,500']),
                            ]),
                    ),
            ]),
    ]
]),
```

Stored json data
----------------

[](#stored-json-data)

```
{
    "mails": {
        "main": [
            "demo@gmail.com"
        ],
        "countries": [
            {
                "mails": [
                    "demo1@gmail.com",
                    "demo2@gmail.com"
                ],
                "country": "UA"
            },
            {
                "mails": [
                    "demo3@gmail.com"
                ],
                "country": "AS"
            }
        ]
    },
    "brand": {
        "colors": {
            "secondary": "#b1dd8c",
            "primary": "#d95000"
        }
    },
    "tiles": [
        {
            "settings": {
                "primary": false,
                "display": true
            },
            "count": "3",
            "height": "2"
        },
        {
            "settings": {
                "primary": true,
                "display": true
            },
            "count": "1",
            "height": "0.75"
        }
    ],
    "address": {
        "street": "Maidan",
        "city": "Kyiv",
        "country": "Ukraine",
        "location": {
            "longitude": "200",
            "latitude": "100"
        }
    },
    "links": {
        "android": null,
        "ios": null,
        "website": "https:\/\/laravel.com\/"
    }
}
```

Screenshots
-----------

[](#screenshots)

[![screenshot of field](screenshots/field-dark.png)](screenshots/field-dark.png)[![screenshot of field](screenshots/field-detail.png)](screenshots/field-detail.png)[![screenshot of field](screenshots/field-index.png)](screenshots/field-index.png)[![screenshot of field](screenshots/field-mobile.png)](screenshots/field-mobile.png)

Credits
-------

[](#credits)

- [Artem Stepanenko](https://github.com/stepanenko3)

Contributing
------------

[](#contributing)

Thank you for considering contributing to this package! Please create a pull request with your contributions with detailed explanation of the changes you are proposing.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56.3% 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 ~129 days

Recently: every ~88 days

Total

6

Last Release

477d ago

### Community

Maintainers

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

---

Top Contributors

[![stepanenko3](https://avatars.githubusercontent.com/u/31134245?v=4)](https://github.com/stepanenko3 "stepanenko3 (9 commits)")[![xiCO2k](https://avatars.githubusercontent.com/u/823088?v=4)](https://github.com/xiCO2k "xiCO2k (5 commits)")[![Stoyan4o4](https://avatars.githubusercontent.com/u/14353153?v=4)](https://github.com/Stoyan4o4 "Stoyan4o4 (1 commits)")[![wamesro](https://avatars.githubusercontent.com/u/5340873?v=4)](https://github.com/wamesro "wamesro (1 commits)")

---

Tags

jsonlaravelfieldnova

### Embed Badge

![Health badge](/badges/stepanenko3-nova-json/health.svg)

```
[![Health](https://phpackages.com/badges/stepanenko3-nova-json/health.svg)](https://phpackages.com/packages/stepanenko3-nova-json)
```

###  Alternatives

[novadaemon/filament-pretty-json

Read-only field to show pretty json in your filamentphp forms

47436.7k2](/packages/novadaemon-filament-pretty-json)[interaction-design-foundation/nova-html-card

A Laravel Nova card to display arbitrary HTML content

67817.0k3](/packages/interaction-design-foundation-nova-html-card)[dniccum/phone-number

A Laravel Nova phone number field with input masking and validation support.

70456.7k](/packages/dniccum-phone-number)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[dniccum/nova-documentation

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

37118.9k](/packages/dniccum-nova-documentation)[digital-creative/nova-json-wrapper

Allows you to group Nova fields and merge their output into a single JSON column.

1280.3k1](/packages/digital-creative-nova-json-wrapper)

PHPackages © 2026

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