awcodes/mason
Mason is a Filament plugin for composing flexible, block-based content with draggable bricks. Build rich layouts from reusable blocks, store them as JSON, and render them anywhere in your Laravel app. Ideal for pages, posts, and landing pages that need editor-friendly structure.
previewData() (3.6.0) lets a field hand each brick JSON context during editing — the reference case being the edited record's locale so locale-dependent bricks preview correctly. That converts "localized landing pages," "per-tenant blocks," and "campaign defaults" from a bespoke preview build into a field configuration line. This is the single most roadmap-relevant item in the release.null in preview toHtml(). Any preview-accuracy work that was descoped or estimated as engineering can be re-estimated as a one-line change per field. Worth revisiting the backlog for items that were parked for this reason alone.@masonStyles / @masonEntryStyles removes the recurring "clear your view cache after upgrading Mason" support ticket — small per instance, real at portfolio scale.Mason::make('content') field rendering in a Filament form, a brick registered, an entry rendered front-end — before any estimate goes to a steering committee. This is a two-hour spike and the cheapest risk reduction available.Adopt when:
previewData() now supplies.php artisan filament:assets (typically via filament:upgrade in Composer's post-autoload-dump) and can run php artisan view:clear once. Verify this empirically against a staging artifact — do not infer from the Dockerfile.Look elsewhere when:
To executives: Mason is our content-editing layer — the drag-and-drop block builder plus the server-side rendering of published pages. Buying it instead of building avoids roughly an engineering quarter and gives us a maintained editor rather than an internal one we staff indefinitely. v3.6.0 is additive: no breaking API changes, no schema or data migration, two artisan commands at deploy. It ships a genuine security remediation and, for the first time, published security documentation — which materially shortens a security review. It also unlocks localized and per-tenant previews that were previously a bespoke build. The trade is a small, single-maintainer community dependency on the admin surface only; it does not touch data models, APIs, auth, or the storage tier, so blast radius is confined to Filament panels and our own templates.
To engineering: Small upgrade with one non-negotiable step. Bump the Composer constraint, run php artisan filament:assets — mandatory, because the cross-window message-origin fix ships in the browser bundle, so skipping it leaves the vulnerability live while the lockfile says "patched" — then php artisan view:clear once so compiled views pick up render-time style resolution. New capability is opt-in per field: previewData(fn (?Model $record) => [...]) passes JSON-serializable context into brick previews. Two rules: source it from the saved record, not a live form field (the editor reads it once, so unstable payloads produce confusing previews), and never put secrets in it — it travels in the signed render context to the browser. One behavioral caveat: bricks that detected "am I in the editor?" via $data === null must switch to inspecting the data once their field supplies previewData(). That is a silent rendering bug, not a compile error. Audit bricks before enabling the feature; fields without previewData() behave exactly as before. Treat a missing filament:assets in the deploy log as a failed release.
To security and compliance: The editor and its preview iframe now accept messages only from each other, closing a cross-window command path present through 3.5.3. The new security page defines the trust boundary normatively — Mason trusts its signed render context and its own configuration; brick authors must treat brick configuration as untrusted input. Cite that page in the threat model, and confirm our custom bricks sanitize and escape their output: that obligation is ours, not the package's. Note that the mitigation only reaches users after the asset republish — verify the build artifact, not just the Composer lockfile.
Rollout recommendation: No feature flag required. Ship with the next regular deploy in this order — Composer bump → filament:assets → view:clear — with the asset step verified in the build log. Spot-check one multi-brick page preview and published entry styles. Adopt previewData() incrementally afterward, starting with a field whose preview is visibly wrong today (the locale case is the reference implementation), once we have confirmed no bricks depend on the $data === null sentinel.
How can I help you explore Laravel packages today?