happones / filament-jsoneditor
Filament's JSON Editor input
v7.0.0
2026-05-12 18:55 UTC
Requires
- php: ^8.2
- filament/filament: ^5.0
- illuminate/contracts: ^11.0|^12.0|^13.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^9.0|^10.0|^11.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- phpunit/phpunit: ^11.0
- spatie/laravel-ray: ^1.35
README
If you need to have a JSON Editor field within your form. You have it !
Installation
You can install the package via composer:
composer require happones/filament-jsoneditor
php artisan vendor:publish --tag=filament-jsoneditor-img
This command will publish the jsoneditor button's img
Required format
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', ]; }
Usage
[
\Happones\FilamentJsoneditor\Forms\JSONEditor::make('editor');
]
Options
[
\Happones\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']
->options([
'mainMenuBar' => true,
'navigationBar' => true,
'statusBar' => true,
]); // default options can be set in config/filament-jsoneditor.php
]
Global Configuration
You can publish the config file to set global defaults:
php artisan vendor:publish --tag=filament-jsoneditor-config
The config file allows you to set default height, modes, and other JSONEditor options.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
