PHPackages                             jeffersongoncalves/filament-yaml-editor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. jeffersongoncalves/filament-yaml-editor

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

jeffersongoncalves/filament-yaml-editor
=======================================

A YAML editor field for Filament with CodeMirror 6, syntax highlighting, linting, and toolbar support.

3.0.4(3mo ago)5117↓76.7%[1 PRs](https://github.com/jeffersongoncalves/filament-yaml-editor/pulls)MITPHPPHP ^8.2CI passing

Since Apr 4Pushed 3w agoCompare

[ Source](https://github.com/jeffersongoncalves/filament-yaml-editor)[ Packagist](https://packagist.org/packages/jeffersongoncalves/filament-yaml-editor)[ Docs](https://github.com/jeffersongoncalves/filament-yaml-editor)[ GitHub Sponsors](https://github.com/jeffersongoncalves)[ RSS](/packages/jeffersongoncalves-filament-yaml-editor/feed)WikiDiscussions 3.x Synced today

READMEChangelog (10)Dependencies (8)Versions (19)Used By (0)

[![Filament YAML Editor](https://raw.githubusercontent.com/jeffersongoncalves/filament-yaml-editor/3.x/art/jeffersongoncalves-filament-yaml-editor.png)](https://raw.githubusercontent.com/jeffersongoncalves/filament-yaml-editor/3.x/art/jeffersongoncalves-filament-yaml-editor.png)

Filament YAML Editor
====================

[](#filament-yaml-editor)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b7eac41229875805987d7246f7b2a913e442806a2048e1a386450f7cf49b0caf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6566666572736f6e676f6e63616c7665732f66696c616d656e742d79616d6c2d656469746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeffersongoncalves/filament-yaml-editor)[![GitHub Tests Action Status](https://camo.githubusercontent.com/49be8e0e53b7b1e0c5ac349438c33da07a22c8613b5569c4e85551d8c5fd8359/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6566666572736f6e676f6e63616c7665732f66696c616d656e742d79616d6c2d656469746f722f74657374732e796d6c3f6272616e63683d332e78266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/jeffersongoncalves/filament-yaml-editor/actions?query=workflow%3Atests+branch%3A3.x)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/b4a209c5811016c168537a5a0ba7189aa4eebbf6de4c4635e7007807ff7ddc4e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6566666572736f6e676f6e63616c7665732f66696c616d656e742d79616d6c2d656469746f722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d332e78266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/jeffersongoncalves/filament-yaml-editor/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3A3.x)[![Total Downloads](https://camo.githubusercontent.com/2c36484bd432244ee242698b730a60fd4213013a24ecf74ffbf5356b01941563/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6566666572736f6e676f6e63616c7665732f66696c616d656e742d79616d6c2d656469746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeffersongoncalves/filament-yaml-editor)

A rich YAML editor field for [Filament](https://filamentphp.com) powered by [CodeMirror 6](https://codemirror.net/) with syntax highlighting, real-time linting, toolbar, and fullscreen support.

Version Compatibility
---------------------

[](#version-compatibility)

BranchFilamentLaravelPHP`1.x`v310+8.2+`2.x`v411+8.2+`3.x`v511.28+8.2+Installation
------------

[](#installation)

Install the package via Composer:

```
composer require jeffersongoncalves/filament-yaml-editor
```

Publish the assets:

```
php artisan filament:assets
```

Optionally publish the config file:

```
php artisan vendor:publish --tag=filament-yaml-editor-config
```

Usage
-----

[](#usage)

### Form Field

[](#form-field)

```
use JeffersonGoncalves\FilamentYamlEditor\Forms\Components\YamlEditorField;

YamlEditorField::make('config')
    ->withToolbar()
    ->rules(['yaml'])
```

### Fluent API

[](#fluent-api)

MethodDescriptionDefault`->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 themeauto`->light()`Force light themeauto`->autoFormat()`Auto-format YAML on blur`false`### Full Example

[](#full-example)

```
YamlEditorField::make('config')
    ->height(400)
    ->withToolbar()
    ->castState()
    ->autoFormat()
    ->dark()
    ->rules(['yaml'])
    ->placeholder("# paste your YAML here\n")
```

### Table Action (View YAML in Modal)

[](#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.

```
use JeffersonGoncalves\FilamentYamlEditor\Actions\ViewYamlAction;
```

**Filament v4 / v5 (branches `2.x` and `3.x`):**

```
->recordActions([
    ViewYamlAction::make()
        ->column('config')       // required: the model attribute to display
        ->editorHeight(500)      // optional, default 400
        ->dark(),                // optional
])
```

**Filament v3 (branch `1.x`):**

```
->actions([
    ViewYamlAction::make()
        ->column('config'),
])
```

MethodDescriptionDefault`->column(string)`Model attribute containing YAML data (required)—`->editorHeight(int $px)`Editor height inside the modal`400``->dark()`Force dark themeauto`->light()`Force light themeauto### Infolist Entry

[](#infolist-entry)

Displays YAML content in a read-only CodeMirror editor.

```
use JeffersonGoncalves\FilamentYamlEditor\Infolists\Components\YamlEditorEntry;

YamlEditorEntry::make('config')
    ->height(400)
    ->dark()
```

### Eloquent Cast

[](#eloquent-cast)

Use the `YamlCast` to automatically convert between YAML strings and arrays in your Eloquent models:

```
use JeffersonGoncalves\FilamentYamlEditor\Casts\YamlCast;

class Setting extends Model
{
    protected $casts = [
        'config' => YamlCast::class,
    ];
}
```

### Validation Rule

[](#validation-rule)

Use the `ValidYaml` rule directly or via the `yaml` string alias:

```
use JeffersonGoncalves\FilamentYamlEditor\Rules\ValidYaml;

// As a rule object
$request->validate([
    'config' => ['required', new ValidYaml],
]);

// As a string alias (registered by the service provider)
$request->validate([
    'config' => ['required', 'yaml'],
]);
```

Features
--------

[](#features)

- **CodeMirror 6** — Modern editor with syntax highlighting, line numbers, and bracket matching for YAML
- **Real-time linting** — Client-side YAML validation via `js-yaml` with inline error markers
- **Server-side validation** — `ValidYaml` rule using `symfony/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 `$entangle` support with `wire:ignore` for seamless form integration
- **Cast support** — `YamlCast` for Eloquent models, `->castState()` for form field hydration/dehydration
- **Table action** — `ViewYamlAction` opens a modal with read-only syntax-highlighted YAML
- **Infolist entry** — `YamlEditorEntry` for 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
---------------

[](#building-assets)

The package ships with pre-compiled assets in `resources/dist/`. To rebuild after modifying JS or CSS sources:

```
pnpm install
pnpm build
```

For development with watch mode:

```
pnpm dev
```

Testing
-------

[](#testing)

```
composer test
```

Code Quality
------------

[](#code-quality)

```
composer analyse   # PHPStan level 5
composer format    # Laravel Pint
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance90

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

18

Last Release

70d ago

Major Versions

1.0.1 → 3.0.22026-04-04

1.0.2 → 3.0.32026-04-04

1.0.3 → 3.0.42026-04-04

1.x-dev → 2.x-dev2026-04-26

2.x-dev → 3.x-dev2026-04-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/411493?v=4)[Jefferson Gonçalves](/maintainers/jeffersongoncalves)[@jeffersongoncalves](https://github.com/jeffersongoncalves)

---

Top Contributors

[![jeffersongoncalves](https://avatars.githubusercontent.com/u/411493?v=4)](https://github.com/jeffersongoncalves "jeffersongoncalves (26 commits)")

---

Tags

alpinejscodemirrorfilamentfilament-pluginform-fieldlaravellivewirephpyamlyaml-editorlaravelyamleditorcodemirrorfilamentform-field

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jeffersongoncalves-filament-yaml-editor/health.svg)

```
[![Health](https://phpackages.com/badges/jeffersongoncalves-filament-yaml-editor/health.svg)](https://phpackages.com/packages/jeffersongoncalves-filament-yaml-editor)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84215.9k9](/packages/stephenjude-filament-two-factor-authentication)[croustibat/filament-jobs-monitor

Background Jobs monitoring like Horizon for all drivers for FilamentPHP

274327.2k9](/packages/croustibat-filament-jobs-monitor)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6649.5k1](/packages/marcelweidum-filament-passkeys)[stephenjude/filament-debugger

About

104162.2k2](/packages/stephenjude-filament-debugger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
