If you need to have a JSON Editor field within your form. You have it !
You can install the package via composer:
composer require invaders-xx/filament-jsoneditor
php artisan vendor:publish --tag=filament-jsoneditor-img
This command will publish the jsoneditor button's img
The Eloquent Model data must be cast to array or json
Example:
class MyModel extends Model
{
protected $casts = [
'my_field' => 'array',
'another_field' => 'encrypted:json',
];
}
[
\InvadersXX\FilamentJsoneditor\Forms\JSONEditor::make('editor');
]
[
\InvadersXX\FilamentJsoneditor\Forms\JSONEditor::make('editor')
->height(500) // Set height to 500px, default is 300
->modes(['code', 'form', 'text', 'tree', 'view', 'preview']); // default is ['code', 'form', 'text', 'tree', 'view', 'preview']
]
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.