Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Filament Flexible Content Block Pages Laravel Package

statikbe/laravel-filament-flexible-content-block-pages

A Laravel and Filament package for building flexible, block-based pages. Compose pages from reusable content blocks, manage them in the Filament admin panel, and render dynamic layouts without hardcoding page structure. Ideal for CMS-style sites.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with Composer (statikbe/laravel-filament-flexible-content-block-pages) alongside Filament, spatie/laravel-medialibrary and spatie/laravel-translatable — the package leans on all three for media fields and per-locale content.
  • Publish the package config and migrations, then migrate. The config file is the single most important thing to read first: it holds the block registry and the page-template registry, which drive almost everything else.
  • Next, look at the packaged base Page model and the abstract Filament page resource. Most projects either extend these or copy their structure into an app-owned model/resource; knowing which one you're doing shapes the rest of the integration.
  • First use case: a simple static page (e.g. "About us") with two blocks — a rich-text block and an image-with-text block. Register both classes in the block registry, expose the flexible-content field on your page form, save a page, then render the blocks in a Blade view with one partial per block.
  • If you use Laravel Boost, run the guideline sync after install so your AI assistant has the package's block conventions in context (release 4.2.2 is specifically about improving those Boost skills).

Implementation Patterns

  • Central block registry. Register every block class in one place (a dedicated service provider or the published config) keyed by a stable handle. Filament forms, the front-end renderer and any seeders should all resolve blocks through that registry rather than hardcoding class names.
  • One block = model + migration + form schema + Blade partial. Keep the four together in a Blocks/ namespace and mirror the folder in resources/views/blocks/. This makes adding a new block a five-minute, low-risk change.
  • Template registry over page-type sprawl. Rather than a resource per page type, register a handful of templates (default, landing, contact) and let editors pick one. The controller resolves the template to a Blade layout; blocks stay template-agnostic and reusable.
  • Extend vs. own the resource. Extending the abstract page resource is the fast path and keeps you on upgrade rails; building your own resource gives full control over navigation, policies and tabs. Choose once, early — retrofitting is painful.
  • Reuse blocks across models. Because blocks attach to a parent model, the same block set can serve pages, articles or FAQ sections. Extract a shared trait/interface for "has flexible content" instead of duplicating form schemas.
  • Media handling. Register image conversions on the block model itself so hero/thumbnail sizes stay consistent, and always render through the media library's URL helpers rather than raw paths.
  • Localisation. Mark block fields translatable and render with the current locale plus fallback; editors expect a page to be translatable per field, not per block.
  • Front end. A single @foreach over ordered blocks with @include('blocks.' . $block->handle) keeps the page view trivial. Wrap the rendered output in fragment caching keyed by page ID and updated_at.
  • Testing. Factory up a page with two or three blocks and assert the rendered HTML contains each block's marker string — this catches missing views and registry typos cheaply.

Gotchas and Tips

  • Registry/class mismatch is the most common failure: a block registered under one handle but saved with another silently disappears from the form. Keep handles in constants used by both the registry and the model.
  • Blank output usually means a missing view, not a broken block. The renderer fails quietly; add a debug branch in local env that dumps the resolved view name.
  • Migration shape matters. The blocks table relies on the polymorphic/foreign key the package expects — don't rename those columns when publishing, and add an index on the parent key plus order_column.
  • Orphaned blocks. Deleting a page doesn't necessarily cascade. Add a deleting observer on the parent model (or a DB-level cascade) or your blocks table will grow stale rows that break re-ordering.
  • Caching. Any page-level cache must be invalidated from block saved/deleted events, not just from the page model — editors update blocks far more often than they re-save the page.
  • Ordering quirks. Reorder operations need a stable order_column with no gaps; if you import content programmatically, re-sequence manually afterwards.
  • Upgrading to 4.2.2 is safe. It only improves the packaged Boost skills/guidelines — no migrations, no API or config changes, no deprecations. The one action worth taking is re-syncing Boost guidelines so AI-assisted block scaffolding matches the current conventions.
  • Extension points to prefer over forking: published views for markup changes, a custom abstract block model for shared behaviour, the template registry for layout variants, and the block registry for conditional registration (e.g. only register commerce blocks when the shop module is enabled).
  • Pin the minor version (^4.2) in composer.json; patch releases in this line have been non-breaking, and the package touches Filament form APIs where majors do break.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource