Download the PHP package jeffersongoncalves/filament-yaml-editor without Composer
On this page you can find all versions of the php package jeffersongoncalves/filament-yaml-editor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeffersongoncalves/filament-yaml-editor
More information about jeffersongoncalves/filament-yaml-editor
Files in jeffersongoncalves/filament-yaml-editor
Package filament-yaml-editor
Short Description A YAML editor field for Filament with CodeMirror 6, syntax highlighting, linting, and toolbar support.
License MIT
Homepage https://github.com/jeffersongoncalves/filament-yaml-editor
Informations about the package filament-yaml-editor
Filament YAML Editor
A rich YAML editor field for Filament powered by CodeMirror 6 with syntax highlighting, real-time linting, toolbar, and fullscreen support.
Version Compatibility
| Branch | Filament | Laravel | PHP |
|---|---|---|---|
1.x |
v3 | 10+ | 8.2+ |
2.x |
v4 | 11+ | 8.2+ |
3.x |
v5 | 11.28+ | 8.2+ |
Installation
Install the package via Composer:
Publish the assets:
Optionally publish the config file:
Usage
Form Field
Fluent API
| Method | Description | Default |
|---|---|---|
->height(int $px) |
Editor height in pixels | 300 |
->minLines(int $lines) |
Minimum visible lines | null |
->readOnly() |
Read-only mode | false |
->withToolbar() |
Enable toolbar (format, copy, fullscreen) | false |
->castState() |
Convert YAML to array on dehydrate, array to YAML on hydrate | false |
->rules(['yaml']) |
Add server-side YAML validation via ValidYaml rule |
— |
->placeholder(string) |
Placeholder text | null |
->dark() |
Force dark theme | auto |
->light() |
Force light theme | auto |
->autoFormat() |
Auto-format YAML on blur | false |
Full Example
Table Action (View YAML in Modal)
Use the ViewYamlAction to add a button in your table that opens a modal with the YAML content displayed in a read-only CodeMirror editor.
Filament v4 / v5 (branches 2.x and 3.x):
Filament v3 (branch 1.x):
| Method | Description | Default |
|---|---|---|
->column(string) |
Model attribute containing YAML data (required) | — |
->editorHeight(int $px) |
Editor height inside the modal | 400 |
->dark() |
Force dark theme | auto |
->light() |
Force light theme | auto |
Infolist Entry
Displays YAML content in a read-only CodeMirror editor.
Eloquent Cast
Use the YamlCast to automatically convert between YAML strings and arrays in your Eloquent models:
Validation Rule
Use the ValidYaml rule directly or via the yaml string alias:
Features
- CodeMirror 6 — Modern editor with syntax highlighting, line numbers, and bracket matching for YAML
- Real-time linting — Client-side YAML validation via
js-yamlwith inline error markers - Server-side validation —
ValidYamlrule usingsymfony/yaml - Toolbar — Format (pretty-print), copy to clipboard, fullscreen toggle
- Theme support — Auto-detects Filament dark mode and system
prefers-color-scheme, or force with->dark()/->light() - Bidirectional sync — Full Livewire
$entanglesupport withwire:ignorefor seamless form integration - Cast support —
YamlCastfor Eloquent models,->castState()for form field hydration/dehydration - Table action —
ViewYamlActionopens a modal with read-only syntax-highlighted YAML - Infolist entry —
YamlEditorEntryfor read-only YAML display in resource view pages - Fullscreen mode — Full-screen editing with mobile safe-area insets
- No Tailwind dependency — CSS built with PostCSS (autoprefixer + cssnano), works in any Filament panel
Building Assets
The package ships with pre-compiled assets in resources/dist/. To rebuild after modifying JS or CSS sources:
For development with watch mode:
Testing
Code Quality
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-yaml-editor with dependencies
filament/filament Version ^5.0
spatie/laravel-package-tools Version ^1.16
symfony/yaml Version ^6.4|^7.0|^8.0