88
99## 💡 What is Filament Json Field?
1010
11- Filament Json Field is a Filament wrapper for Codemirror .
11+ Filament Json Field is a Laravel Filament JSON Field integration with CodeMirror support, providing a powerful and feature-rich JSON editor for your Filament forms and infolists .
1212
1313## 🛠 Requirements
1414
15- | Package | PHP | Laravel | Filament Infolists | Filament Support | Filament Tables |
16- | -----------| ------------------| ---------------| --------------------| ------------------| -----------------|
17- | v12.0 | ^8.2, ^8.3, ^8.4 | ^12.0 | ^3.3 | ^3.3 | ^3.3 |
18- | v2.0 | ^8.1 | ^11.0 | ^3.2 | ^3.2 | ^3.2 |
19- | v1.0 | ^8.1 | ^10.45, ^11.0 | ^3.2 | ^3.2 | ^3.2 |
15+ | Package | PHP | Laravel | Filament Forms | Filament Infolists | Filament Support |
16+ | -----------| ------------------| ---------------| ----------------| --------------------| ------------------|
17+ | v13.0 | ^8.2, ^8.3, ^8.4 | ^12.0 | ^4.0 | ^4.0 | ^4.0 |
18+ | v12.0 | ^8.2, ^8.3, ^8.4 | ^12.0 | ^3.3 | ^3.3 | ^3.3 |
19+ | v2.0 | ^8.1 | ^11.0 | ^3.2 | ^3.2 | ^3.2 |
20+ | v1.0 | ^8.1 | ^10.45, ^11.0 | ^3.2 | ^3.2 | ^3.2 |
2021
2122
2223## ⚙️ Installation
@@ -31,7 +32,8 @@ php artisan filament:assets
3132
3233## Usage
3334
34- Forms:
35+ ### Forms
36+
3537``` php
3638use CodebarAg\FilamentJsonField\Forms\Components\JsonInput;
3739
@@ -42,30 +44,31 @@ public function form(Form $form): Form
4244 return $form
4345 ->schema([
4446 JsonInput::make('json')
45- ->label('JSON')
47+ ->label('JSON Data ')
4648 ->lineNumbers(true)
4749 ->lineWrapping(true)
4850 ->autoCloseBrackets(true)
4951 ->darkTheme(true)
5052 ->foldingCode(true)
51- ->foldedCode(true), // Folded code will fold the code on form load
53+ ->foldedCode(true) // Folded code will fold the code on form load
54+ ->readOnly(false), // Set to true to make the field read-only
5255 ]);
5356}
54- ...
55- ````
57+ ```
58+
59+ ### Infolists
5660
57- Infolists:
5861``` php
5962use CodebarAg\FilamentJsonField\Infolists\Components\JsonEntry;
6063
6164...
6265
63- public function form(Form $form ): Form
66+ public function infolist(Infolist $infolist ): Infolist
6467{
65- return $form
68+ return $infolist
6669 ->schema([
6770 JsonEntry::make('json')
68- ->label('JSON')
71+ ->label('JSON Data ')
6972 ->lineNumbers(true)
7073 ->lineWrapping(true)
7174 ->autoCloseBrackets(true)
@@ -74,19 +77,30 @@ public function form(Form $form): Form
7477 ->foldedCode(true), // Folded code will fold the code on form load
7578 ]);
7679}
77- ...
78- ````
80+ ```
7981
8082### Options
8183
8284The following options are currently supported:
8385
84- | Request | Supported |
85- |---------------------|:-----------:|
86- | Line Numbers | ✅ |
87- | Auto Close Brackets | ✅ |
88- | Dark Theme | ✅ |
89- | Folding Code | ✅ |
86+ | Option | Supported | Description |
87+ | ---------------------| :---------:| -------------|
88+ | Line Numbers | ✅ | Display line numbers in the editor |
89+ | Line Wrapping | ✅ | Enable line wrapping for long lines |
90+ | Auto Close Brackets | ✅ | Automatically close brackets and quotes |
91+ | Dark Theme | ✅ | Enable dark theme styling |
92+ | Folding Code | ✅ | Enable code folding functionality |
93+ | Folded Code | ✅ | Start with code folded (forms only) |
94+ | Read Only | ✅ | Make the field read-only (forms only) |
95+
96+ ### Features
97+
98+ - ** CodeMirror Integration** : Powered by CodeMirror 5 for excellent JSON editing experience
99+ - ** Syntax Highlighting** : Full JSON syntax highlighting with validation
100+ - ** Error Handling** : Built-in JSON validation with user-friendly error messages
101+ - ** Responsive Design** : Works seamlessly across different screen sizes
102+ - ** Customizable** : Extensive configuration options for different use cases
103+ - ** Filament 4.0 Ready** : Fully compatible with the latest Filament version
90104
91105## 🚧 Testing
92106
0 commit comments