Laravel Nova field for displaying JSON schema data
You can install the package into a Laravel app that uses Nova via composer:
composer require nsavinov/nova-json-schema-field
Inside the resource:
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:
{
"type": "object",
"required": [
"foo",
"bar"
],
"properties": {
"bar": {
"type": "integer"
},
"foo": {
"type": "integer",
"description": "foo"
}
}
}