PHPackages                             digital-creative/nova-json-wrapper - 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. digital-creative/nova-json-wrapper

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

digital-creative/nova-json-wrapper
==================================

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

v0.2.0(5y ago)1379.9k10[2 PRs](https://github.com/dcasia/nova-json-wrapper/pulls)1MITPHPPHP &gt;=7.1.0

Since Oct 15Pushed 1y ago2 watchersCompare

[ Source](https://github.com/dcasia/nova-json-wrapper)[ Packagist](https://packagist.org/packages/digital-creative/nova-json-wrapper)[ RSS](/packages/digital-creative-nova-json-wrapper/feed)WikiDiscussions master Synced 1mo ago

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

Nova Json Wrapper
=================

[](#nova-json-wrapper)

[![Latest Version on Packagist](https://camo.githubusercontent.com/444196e16508b8dd03f946e982c07172ae36a0ab72195ef0a5ff8bc2f460bc4e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6469676974616c2d63726561746976652f6e6f76612d6a736f6e2d77726170706572)](https://packagist.org/packages/digital-creative/nova-json-wrapper)[![Total Downloads](https://camo.githubusercontent.com/7fdce2ba6b397956ac2f3182bed518163323e008a38822f8a1da95e0c88ba69f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6469676974616c2d63726561746976652f6e6f76612d6a736f6e2d77726170706572)](https://packagist.org/packages/digital-creative/nova-json-wrapper)[![License](https://camo.githubusercontent.com/8710a305c8e74cc0adbb2ccb9dbcfabc163e8d5072963af384b71a4d165290d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6469676974616c2d63726561746976652f6e6f76612d6a736f6e2d77726170706572)](https://github.com/dcasia/nova-json-wrapper/blob/master/LICENSE)

This field allows you to group Nova fields and merge their output into a single JSON column.

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

[](#installation)

You can install the package via composer:

```
composer require digital-creative/nova-json-wrapper

```

Usage
-----

[](#usage)

Firstly you will need to update your model to cast the value of your attribute to an array:

```
class User extends Model
{
    protected $casts = [
        'options' => 'array'
    ];
}
```

Then create a `JsonWrapper` field within your nova resource and use the `HasJsonWrapper` trait.

```
use DigitalCreative\JsonWrapper\JsonWrapper;
use DigitalCreative\JsonWrapper\HasJsonWrapper;

class User extends Resource
{
    use HasJsonWrapper; // Important!

    public function fields(Request $request)
    {
        //...
        JsonWrapper::make('options', [

            Text::make('First Name')->rules('required'),
            Text::make('Last Name')->rules('required'),

            JsonWrapper::make('body_mass', [

                Text::make('Weight')->rules('required'),
                Text::make('Height')->rules('required'),

            ])

        ])
    }

}
```

This converts to

```
{ "first_name": "John", "last_name": "Doe", "body_mass": { "weight": 70, "height": 180 } }
```

and saves to the `options` column on the database.

Notes
-----

[](#notes)

There are no visual indications that the field is wrapped within a json, this is intentional. It was designed to work in condition with [Conditional Container](https://github.com/dcasia/conditional-container) allowing to seamlessly create complex data structure and having it all saved in a single json column into your database, here is an full example:

```
public function fields(Request $request)
{
    Select::make('Type')
          ->options([
              1, 2, 3, 4, 5
          ])
          ->rules('required'),

    ConditionalContainer::make([

        JsonWrapper::make('data', [

            Text::make('First Name')->rules('required'),
            Text::make('Last Name')->rules('required'),

            Select::make('Gender')
                  ->options([
                      'male' => 'Male',
                      'female' => 'Female'
                  ])
                  ->rules('required'),

            ConditionalContainer::make([ JsonWrapper::make('extra', [ ... ]) ])->if('gender === male'),
            ConditionalContainer::make([ JsonWrapper::make('extra', [ ... ]) ])->if('gender === female'),

        ])

    ])->if('type >= 2'),
}
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://raw.githubusercontent.com/dcasia/nova-json-wrapper/master/LICENSE) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.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 ~60 days

Recently: every ~111 days

Total

9

Last Release

1923d ago

### Community

Maintainers

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

---

Top Contributors

[![milewski](https://avatars.githubusercontent.com/u/2874967?v=4)](https://github.com/milewski "milewski (7 commits)")[![mennotempelaar](https://avatars.githubusercontent.com/u/6905655?v=4)](https://github.com/mennotempelaar "mennotempelaar (2 commits)")[![bolechen](https://avatars.githubusercontent.com/u/195015?v=4)](https://github.com/bolechen "bolechen (1 commits)")[![hello-liang-shan](https://avatars.githubusercontent.com/u/47734732?v=4)](https://github.com/hello-liang-shan "hello-liang-shan (1 commits)")[![natbentley](https://avatars.githubusercontent.com/u/37216142?v=4)](https://github.com/natbentley "natbentley (1 commits)")

---

Tags

jsonjson-wrapperlaravellaravel-nova-fieldnovajsonlaravelnovajson-wrapper

### Embed Badge

![Health badge](/badges/digital-creative-nova-json-wrapper/health.svg)

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

###  Alternatives

[stepanenko3/nova-json

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

42249.7k](/packages/stepanenko3-nova-json)[interaction-design-foundation/nova-html-card

A Laravel Nova card to display arbitrary HTML content

67731.2k3](/packages/interaction-design-foundation-nova-html-card)[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)[json-mapper/laravel-package

The JsonMapper package for Laravel

25170.4k3](/packages/json-mapper-laravel-package)

PHPackages © 2026

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