64robots/nova-json

This package is abandoned and no longer maintained. No replacement package was suggested.

JSON Laravel Nova field.

Maintainers

👁 64robots

Package info

github.com/64robots/nova-json

pkg:composer/64robots/nova-json

Statistics

Installs: 7 906

Dependents: 0

Suggesters: 0

Stars: 20

Open Issues: 0

1.0.6 2018-09-17 18:24 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 9f6a8511618e7d7d31a811b69308ffd8a687471d

jsonnovalaravelfield

This package is auto-updated.

Last update: 2020-01-29 05:31:26 UTC


README

This field has been merged to Custom Nova Fields package. Keep track of it for updates!

JSON Field for Laravel Nova

This field allows you to group together Nova Fields and merge their key => value pairs into unique JSON.

Demo

👁 Demo

Install

Run this command in your nova project: composer require 64robots/nova-fields

Add it to your Nova Resource:

Create a new Json field passing an array of Nova Fields as second param

use R64\NovaFields\JSON;


JSON::make('Content', [
 Text::make('Name'),
 Boolean::make('Active'),
 Textarea::make('Description'),
 ]),

Attribute name can be passed as third param

use R64\NovaFields\JSON;


JSON::make('Content', [
 Text::make('Name'),
 Boolean::make('Active'),
 Textarea::make('Description'),
 ], 'content_json'),

This converts to

{ "name": "Jane", "active": true, "description": "My Description" }

and is stored in the content_json field.

In this example ensure that the content_json field is being set to cast to object on the underlying model instance.