creagia/filament-code-field
A CodeMirror-powered code field for Filament forms with syntax highlighting, autocompletion, light/dark modes, multiple languages (JSON, PHP, HTML, XML, JavaScript), and read-only support.
Architecture fit
Field, plus pre-compiled CodeMirror JS/CSS shipped in the package. No service provider to register, no config to publish, no migrations, no queue workers, no API surface. It renders inside the Livewire form tree and binds a single model attribute like any other field.rules() closure. A TPM must spec "invalid code is rejected at save" as a separate line item with its own estimate — it is not something this dependency delivers.Integration feasibility
composer require creagia/filament-code-field, then CodeField::make('settings_json') in a schema. Language via setLanguage() or helpers (->jsField(), ->htmlField()), plus withLineNumbers(), disableAutocompletion(), disabled() for read-only, and all inherited Filament methods (label(), hint(), helper()). The entire public API fits in the README — a good sign at this size.^3.0 requires Filament 3 and Laravel 11; ^2.0 is the correct choice for Filament 3 on Laravel 10–12; ^1.0 is Filament 2. A team on Laravel 12 that naively takes the newest tag will fail resolution or hit runtime breakage. Verify against the actual composer.json before the spike, not during it.1.0.2, while the README's supported-language list stops at JSON/PHP/HTML/XML/JS. Any language-dependent feature must be proven in your pinned version rather than assumed.Technical risk
Field and ships JS that hooks Filament's asset and theming behaviour, a Filament major (v3 → v4) is the breakage trigger, and your remediation schedule depends on a third party's release timing. Budget a lag on every Filament major.Textarea is a one-file change.composer audit plus a read of the compiled bundle.Key questions to resolve before commitment
1.0.11.)vendor/, no CDN dependency, CSP permits its style injection)?Stack fit. Prerequisites are a Filament 3 panel on PHP 8.1–8.4 with Laravel 10–12 (pin ^2.0) or Laravel 11 with ^3.0. Note that the ^2.0 branch is the broader compatibility line for Filament 3 — this inverts the default "always latest" instinct and must be written into the ticket so Composer does not silently resolve the wrong major.
Migration path. There is nothing to migrate. Existing plain Textarea / KeyValue fields are replaced one at a time by swapping the field class in the schema; the underlying column and model are untouched, so the change is reversible per-screen with no data migration. Introduce it through a thin internal wrapper (e.g. App\Filament\Fields\CodeField extends Creagia\...\CodeField) that pins the language defaults and any house styling, so an upstream break or abandonment becomes a one-file swap back to Textarea rather than a hunt across schemas.
Compatibility. Treat three axes independently: (a) Composer resolution against the pinned Laravel/Filament versions, (b) asset delivery in the real deployment pipeline (staging, behind your CDN and CSP), (c) behavioural fit — dark mode, RTL locales if you ship them, and multiple editors per page. (c) is where every historical bug in this changelog lived, so prove it on a real screen rather than in isolation.
Sequencing.
json, custom PHP-parse closure, length caps via the 3.0.2 min/max length API) and a clear user-facing error message.composer audit step in CI, Dependabot watching the package, and a written note in the ADR that Filament v4 will require a compatibility check here.Maintenance. Low ongoing effort in steady state: no config, no migrations, no background jobs, no infrastructure. The recurring cost is version babysitting at two boundaries — Laravel/Filament upgrades and PHP upgrades — plus periodic composer audit follow-through on the bundled JS dev-dependency chain (several recent releases were security bumps to dev dependencies only, which do not affect the published artifact but do generate noise). Assign a named owner for the wrapper class; treat it as a small internal library, not a fire-and-forget require.
Support. Support load should be near zero if you set expectations up front: this is a text box with colours, not a linter. Pre-empt the predictable tickets — "it says my JSON is invalid but it looks fine" (that is your validation rule, route it accordingly), "autocomplete is wrong" (CodeMirror defaults, disable per-field if it misleads), "it looks small on my laptop" (min/max height settings, stabilised in 1.0.11). Publish a one-paragraph internal note on the field's scope. Because the vendor is a small shop with 57 stars, do not route user tickets upstream; assume you own first-line support and that upstream fixes are best-effort.
Scaling. Vertically trivial — the component costs one CodeMirror instance per rendered field on the client and essentially nothing server-side. The only scaling constraint is per-page editor count: mount one or two, not five; each is an independent JS instance with its own height and theming logic, and that is historically the buggiest area of this package. Payload size should be bounded by a validation max (a code field is for snippets, not for 2 MB documents) to protect Livewire request payloads. There is no horizontal scaling, licensing, or per-seat dimension at all.
Failure modes and responses.
Textarea via the wrapper.1.0.11; verify on the pinned version.Ramp-up. Dev ramp-up is roughly an hour: any developer who has written a Filament form field already knows the API, and the README is complete. No new infrastructure, no new language, no new operational surface for on-call. The more important ramp-up is product: stakeholders should hear explicitly that this gives syntax colouring and completion, and that validation, diffing, and execution safety are separate features with separate estimates. Setting that expectation at kickoff is the highest-leverage thing a TPM does for this dependency.
How can I help you explore Laravel packages today?