pepperfm/filament-json
pepperfm/filament-json provides Filament components for editing and displaying JSON in Laravel admin panels. It supports formatting, validation, and readable previews, making nested configuration, metadata, and API payloads easier to manage without custom UI code.
composer require pepperfm/filament-json and confirm your Filament major matches the 5.x branch requirements. 5.0.2 is a patch release — no install changes versus 5.0.1, so existing apps only need composer update pepperfm/filament-json.src/ and the Blade view it renders. Publish views/config only if you actually need to override markup; the package ships sane defaults.TextEntry that dumps a json column (or a ->formatStateUsing(fn ($state) => json_encode($state, JSON_PRETTY_PRINT)) hack) with the package entry in an infolist or resource view. Point it at the attribute, pick tree or table rendering, and you get collapsible structured output without writing a custom view.JsonEntry::make('payload') on a model with an array/json cast, or on a form field whose state is computed, renders correctly without extra normalization.->state(...), ->getStateUsing(...), ->default(...), or a relationship path (customer.settings) directly on the entry. As of 5.0.2 the package resolves state through Filament first and only then normalizes, so separators (dot notation) and state caching behave as they do for any other entry. Delete any workarounds that manually called state() or pre-encoded values before passing them in.json/text that hold a JSON string no longer need a cast or json_decode in the entry. Valid JSON decodes into tree/table content; invalid JSON falls back to rendering as a scalar string, which is a useful safety net for legacy/dirty rows.Arrayable/collections in computed state. Returning an Eloquent model, a collection, or a DTO implementing Arrayable from getStateUsing() is supported — good pattern for "show the serialized shape of this resource" panels without duplicating cast logic.false, 0, "0", and "" render instead of disappearing. Useful for feature-flag/config inspector screens where "off" is meaningful information; you can stop writing ?? '—' shims inside formatStateUsing.filterNullable() for actual nulls. It now removes only null entries. Use it to strip absent keys from sparse API payloads, and not as a general "hide empty values" switch — pair it with an explicit callback if you also want to hide empty strings or zeroes.Section or Tab alongside metadata entries, and gate it behind ->visible(fn ($record) => filled($record->payload)) (checking for null, not emptiness) so records without JSON don't show an empty shell."true", "123", "null", a quoted string) will parse into structure rather than render literally. If a column genuinely stores JSON-encoded scalars — very common for settings values of type string — wrap them at the source (e.g. encode into an object {"value": "123"}) or skip this entry for that attribute.filterNullable() behaviour changed in 5.0.2. If you relied on it to drop "", 0, or false, those values will now appear. Audit every call site during the upgrade; this is the only change in the release with visible output differences.getStateUsing() and then passed an array, or that reached into the entry's state after mount, can now double-normalize or bypass Filament's caching. Prefer the plain attribute path and let the package handle decoding.->visible() on filled($state) evaluates "0" as empty in some helpers — use !== null when the state may legitimately be a falsy JSON value, otherwise you hide exactly the content this release added support for.dump()/dd() the value inside getStateUsing() first; if the state is a valid structure but the pane is empty, check whether a custom ->view() or a published (stale) Blade view is overriding the hardened default — republish or delete the override after upgrading.Arrayable/JsonSerializable convert cleanly. Arbitrary value objects or stdClass graphs may need an explicit cast in getStateUsing().->view(), plus any publishable config for defaults such as render mode and depth. Keep overrides minimal — 5.0.2's fixes live in the normalization path and Blade view, so a fork of the markup will silently miss future hardening.5.x branch now runs tests and PHP code-style checks on GitHub Actions; run the project's formatter (Pint) and full test suite before opening a PR, since style failures will block the workflow.How can I help you explore Laravel packages today?