invaders-xx / filament-jsoneditor
Filament's JSON Editor input
Installs: 113 258
Dependents: 2
Suggesters: 0
Security: 0
Stars: 22
Watchers: 3
Forks: 14
Open Issues: 1
Requires
- php: ^8.0
- filament/filament: ^3.0
- illuminate/contracts: ^8.74|^9.0|^10.0|^11.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
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 invaders-xx/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
[ \InvadersXX\FilamentJsoneditor\Forms\JSONEditor::make('editor'); ]
Options
[ \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'] ]
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.