Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/invaders-xx/filament-jsoneditor
https://github.com/invaders-xx/filament-jsoneditor
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/invaders-xx/filament-jsoneditor
- Owner: invaders-xx
- License: mit
- Created: 2022-03-28T14:21:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-17T04:34:24.000Z (8 months ago)
- Last Synced: 2024-05-07T22:33:35.069Z (8 months ago)
- Language: PHP
- Size: 376 KB
- Stars: 20
- Watchers: 4
- Forks: 16
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-filament - invaders-xx/filament-jsoneditor - JSON Editor form input field. (Fields)
README
# JSON Editor form's input for the great Filament package
[![Latest Version on Packagist](https://img.shields.io/packagist/v/invaders-xx/filament-jsoneditor.svg?style=flat-square)](https://packagist.org/packages/invaders-xx/filament-jsoneditor)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/invaders-xx/filament-jsoneditor/run-tests?label=tests)](https://github.com/invaders-xx/filament-jsoneditor/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/invaders-xx/filament-jsoneditor/Check%20&%20fix%20styling?label=code%20style)](https://github.com/invaders-xx/filament-jsoneditor/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/invaders-xx/filament-jsoneditor.svg?style=flat-square)](https://packagist.org/packages/invaders-xx/filament-jsoneditor)If you need to have a JSON Editor field within your form. You have it !
## Installation
You can install the package via composer:
```bash
composer require invaders-xx/filament-jsoneditor
``````bash
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 jsonExample:
```php
class MyModel extends Model
{
protected $casts = [
'my_field' => 'array',
'another_field' => 'encrypted:json',
];
}
```## Usage
```php
[
\InvadersXX\FilamentJsoneditor\Forms\JSONEditor::make('editor');
]
```
## Options
```php
[
\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```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [David Vincent](https://github.com/invaders-xx)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.