Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/nikolaysav/nova-json-schema-field
- Owner: NikolaySav
- Created: 2018-09-05T21:06:01.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-27T08:57:57.000Z (about 6 years ago)
- Last Synced: 2024-10-01T05:01:18.170Z (about 2 months ago)
- Topics: json, jsonschema, laravel, nova, vue
- Language: Vue
- Homepage: https://novapackages.com/packages/nsavinov/nova-json-schema-field
- Size: 43 KB
- Stars: 26
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
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
## 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"
}
}
}
```