Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nikolaysav/nova-json-schema-field

Laravel Nova field for displaying JSON schema data
https://github.com/nikolaysav/nova-json-schema-field

json jsonschema laravel nova vue

Last synced: about 1 month ago
JSON representation

Laravel Nova field for displaying JSON schema data

Awesome Lists containing this project

README

        

# JSON schema field for Laravel Nova

[![Packagist](https://img.shields.io/packagist/dt/nsavinov/nova-json-schema-field.svg)](https://packagist.org/packages/nsavinov/nova-json-schema-field)

Laravel Nova field for displaying [JSON schema](https://json-schema.org/) data

screenshot at sep 06 15-11-54

## Installation

You can install the package into a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```bash
composer require nsavinov/nova-json-schema-field
```

## Usage
Inside the resource:

```php
use Nsavinov\NovaJsonSchemaField\NovaJsonSchemaField;

public function fields(Request $request)
{
return [
// ...
NovaJsonSchemaField::make('Settings', $this->schema())
->listClass('list-reset'), // optional style class for detailed component
];
}

private function schema(): array
{
return [
// your schema
];
}

```

Schema example:

```json
{
"type": "object",
"required": [
"foo",
"bar"
],
"properties": {
"bar": {
"type": "integer"
},
"foo": {
"type": "integer",
"description": "foo"
}
}
}
```