PHPackages                             statikbe/laravel-filament-flexible-content-blocks - 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. [Templating &amp; Views](/categories/templating)
4. /
5. statikbe/laravel-filament-flexible-content-blocks

ActiveLibrary[Templating &amp; Views](/categories/templating)

statikbe/laravel-filament-flexible-content-blocks
=================================================

The Laravel Filament Flexible Content Blocks package helps you to easily create content in Filament for any model, with predefined or custom blocks, and foreach block an extendable Blade view component.

v4.0.3(2mo ago)17021.0k—0%27[6 issues](https://github.com/statikbe/laravel-filament-flexible-content-blocks/issues)[3 PRs](https://github.com/statikbe/laravel-filament-flexible-content-blocks/pulls)2MITPHPPHP ^8.2CI passing

Since Mar 8Pushed 1mo ago7 watchersCompare

[ Source](https://github.com/statikbe/laravel-filament-flexible-content-blocks)[ Packagist](https://packagist.org/packages/statikbe/laravel-filament-flexible-content-blocks)[ Docs](https://github.com/statikbe/laravel-filament-flexible-content-blocks)[ RSS](/packages/statikbe-laravel-filament-flexible-content-blocks/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (22)Versions (91)Used By (2)

[![Laravel Filament Flexible cContent Blocks](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/banner-laravel-filament-flexible-content-blocks.png)](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/banner-laravel-filament-flexible-content-blocks.png)

Laravel Filament Flexible Content Blocks
========================================

[](#laravel-filament-flexible-content-blocks)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fb8f29ce2af6c9414ad94a9ce7cc6f0e5ff147eeaab3c6452b4ea65b995eb182/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746174696b62652f6c61726176656c2d66696c616d656e742d666c657869626c652d636f6e74656e742d626c6f636b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/statikbe/laravel-filament-flexible-content-blocks)[![GitHub Tests Action Status](https://camo.githubusercontent.com/35c0822bc0048ad9d2ef280166985f97230e1e46dd98fce1bb32115e5557e103/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73746174696b62652f6c61726176656c2d66696c616d656e742d666c657869626c652d636f6e74656e742d626c6f636b732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/statikbe/laravel-filament-flexible-content-blocks/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/5008012aa25d473f0f38dae97295adaeeb6ebfcea0232a3e2b13d6f8d4110840/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73746174696b62652f6c61726176656c2d66696c616d656e742d666c657869626c652d636f6e74656e742d626c6f636b732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/statikbe/laravel-filament-flexible-content-blocks/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ba3ff80d77c5ec483cd54a4032072c9e95570f860b4d991a21ddde14b4e34b08/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73746174696b62652f6c61726176656c2d66696c616d656e742d666c657869626c652d636f6e74656e742d626c6f636b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/statikbe/laravel-filament-flexible-content-blocks)

The Laravel Filament Flexible Content Blocks package helps you to easily create content in Filament for any model, with predefined blocks, and for each block an extendable Blade view component.

You can use this opinionated package to create a basic CMS, by setting up your own page model and implementing the predefined traits to select the functionality you need, then quickly setup a Filament resource by implementing the ready-made fields. Or you can add flexible content to a model for your specific business case, for instance to allow the flexible creation of a product description. Each project is different and to foster changing requirements, the focus is on the building blocks and not a default implementation for a CMS-like page.

The key goals of this package are:

- provide a quick way to add content to a model through reusable fields and content blocks
- quickly set up the frontend and allow different frontend stylings for each block
- have fully-working, extendable Blade view components with basic Tailwind styling
- allow the liberty to pick and choose which fields and blocks you need for your requirements
- provide easy configuration to override the behaviour of the fields, blocks and image conversions
- support SEO
- support overview fields to display the content in a list with custom title, image and description
- support content translations
- provide a start set of content blocks for most general requirements

✨ **New features:**

- Improved styling of the blocks in Filament to improve UX when editing many blocks.
- Replicate action to copy the model with content blocks and its images.
- Content block previews! You can now show a preview of what the block looks like on the actual page, styled with the correct stylesheet. See [the preview block configuration](documentation%2Fconfiguration.md#block-previews).
- 🎨 Simple asset manager, see [Filament Flexible Blocks Asset Manager](https://github.com/statikbe/laravel-filament-flexible-blocks-asset-manager)

**NOTE:**🚀 For a complete, out-of-the-box, content management solution, check out our new [Filament Flexible Content Block Pages](https://github.com/statikbe/laravel-filament-flexible-content-block-pages) package with page management, a menu builder, tag management and many SEO features.

Versions &amp; compatibility
----------------------------

[](#versions--compatibility)

Filament VersionPackage VersionDevelopment Branchv3`statikbe/laravel-filament-flexible-content-blocks:^3.0``v3`v4 &amp; v5`statikbe/laravel-filament-flexible-content-blocks:^4.0``main`Upgrades
--------

[](#upgrades)

### Upgrade to v2

[](#upgrade-to-v2)

The image conversions in the configuration file have changed due to a refactor of spatie-medialibrary v11. Check [the upgrade guide](./UPGRADE.md) for details.

### Upgrade to v1

[](#upgrade-to-v1)

If you need to upgrade to v1.0.0 it is **IMPORTANT** to [read the upgrade guide thoroughly](./UPGRADE.md), because the data model of the content blocks has changed and needs to be upgraded via a command.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require statikbe/laravel-filament-flexible-content-blocks
```

You will most likely need to edit [the extensive configuration](#configuration), so you can publish the config file with:

```
php artisan vendor:publish --tag="filament-flexible-content-blocks-config"
```

Optionally, you can publish the views (e.g. if you want to tweak the content blocks) using:

```
php artisan vendor:publish --tag="filament-flexible-content-blocks-views"
```

Since you can apply the flexible content blocks to any view, we do not provide required or default migrations. However, we provide two example migrations, one for a translatable page and one for a single-language page. You can use these migrations as an example to create your own migrations. (see [ToDo's](#todo)) You can publish and run the migrations with:

```
php artisan vendor:publish --tag="filament-flexible-content-blocks-migrations"
#first edit the migrations and then run:
php artisan migrate
```

### Optional installation steps

[](#optional-installation-steps)

When you want to use the [BackgroundVideo](src/View/Components/BackgroundVideo.php) component, you have to make sure that the javascript files, which are used by the component, are available in your project. To do this, you have to publish the compiled javascript assets by using:

```
php artisan vendor:publish --tag="filament-flexible-content-blocks-assets"
```

To automate the above, so that these assets will be re-published each time you perform a composer update, you can add the following publish command within the `scripts.post-update-cmd` array of your `composer.json`:

```
{
    "scripts": {
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=filament-flexible-content-blocks-assets --force"
        ]
    }
}
```

Dependencies
------------

[](#dependencies)

This is an opinionated package with batteries included. So we picked a set of dependencies to build upon. Here is a brief overview of the choices made:

- `filament/filament`: obviously ;-)
- `spatie/laravel-medialibrary` &amp; `filament/spatie-laravel-media-library-plugin`: all image handling is done with `spatie/medialibrary`
- `spatie/laravel-sluggable`: for slugs
- `spatie/laravel-translatable`: for translations as this works together with the first party filament translatable package.
- `dereuromark/media-embed`: to support video embeds of [various media services](https://github.com/dereuromark/media-embed/blob/master/docs/supported.md).
- `openai-php/laravel`: to generate content and add other smart features ;-).

Usage
-----

[](#usage)

There is [an example project](https://github.com/statikbe/laravel-filament-package-sampler) of all the package features, which includes:

- migrations
- data models for default &amp; translatable pages
- Filament resources &amp; pages
- Http controllers
- views
- a data seeder to generate test pages

You can use this as a starting point to see how the package can be used for a CMS pages. Below we briefly discuss how to setup a migration, a model and a Filament resource in four steps. In the future, we want to add question-based commands to create these, see [roadmap](#roadmap).

### 1. Setup migrations

[](#1-setup-migrations)

You can start from [the example migrations that can be published](#installation). Then prune and pick the fields that fit your requirements, note that some model traits need a combination of fields, e.g. the hero image needs both `hero_image_copyright` and `hero_image_title`. The clusters are commented in the migration or have a look in [the model traits](src/Models/Concerns) to get an idea.

### 2. Setup the model

[](#2-setup-the-model)

If you do not have a model yet, create one with `php artisan make:model`, then you can add the interfaces and its default implementation via traits. Below is an overview of the provided interfaces and traits and their functionality:

#### **[HasPageAttributes](src%2FModels%2FContracts%2FHasPageAttributes.php)**:

[](#haspageattributes)

This adds a title and publishing begin and end date variables, together with functions and scopes to help with finding published models. Implement this interface with the trait [HasPageAttributesTrait](src%2FModels%2FConcerns%2FHasPageAttributesTrait.php)or [HasTranslatedPageAttributesTrait](src%2FModels%2FConcerns%2FHasTranslatedPageAttributesTrait.php)for translated content.

#### **[HasIntroAttribute](src%2FModels%2FContracts%2FHasIntroAttribute.php)**:

[](#hasintroattribute)

This adds an introduction text variable. Implement this interface with the trait [HasIntroAttributeTrait](src%2FModels%2FConcerns%2FHasIntroAttributeTrait.php)or [HasTranslatedIntroAttributeTrait](src%2FModels%2FConcerns%2FHasTranslatedIntroAttributeTrait.php).

#### **[HasCode](src%2FModels%2FContracts%2FHasCode.php)**:

[](#hascode)

Adds a code variable to be able to select a specific content model in your source code by string instead of a varying id or slug. For instance, this is useful to look up a home page. Implement this with the trait [HasCodeTrait](src%2FModels%2FConcerns%2FHasCodeTrait.php).

#### **[HasHeroImageAttributes](src%2FModels%2FContracts%2FHasHeroImageAttributes.php)**:

[](#hasheroimageattributes)

Adds a hero image as well as a title (e.g. for accessibility in `alt` tags) and copyright variable to the model. This can be implemented with [HasHeroImageAttributesTrait](src%2FModels%2FConcerns%2FHasHeroImageAttributesTrait.php) and [HasTranslatedHeroImageAttributesTrait](src%2FModels%2FConcerns%2FHasTranslatedHeroImageAttributesTrait.php).

#### **[HasHeroVideoUrlAttribute](src/Models/Contracts/HasHeroVideoAttribute.php)**:

[](#hasherovideourlattribute)

Adds a hero video URL that can be used to create a hero with a video playing in the background. This can be implemented with [HasHeroVideoAttributeTrait](src/Models/Concerns/HasHeroVideoAttributeTrait.php) and [HasTranslatedHeroVideoUrlAttributeTrait](src/Models/Concerns/HasTranslatedHeroVideoUrlAttributeTrait.php).

#### **[HasContentBlocks](src%2FModels%2FContracts%2FHasContentBlocks.php)**:

[](#hascontentblocks)

Adds a JSON column to your model to store the data of the flexible content blocks. This is required if you want to use the flexible content blocks. Implement it with [HasContentBlocksTrait](src%2FModels%2FConcerns%2FHasContentBlocksTrait.php) or [HasTranslatedContentBlocksTrait](src%2FModels%2FConcerns%2FHasTranslatedContentBlocksTrait.php).

#### **[HasMediaAttributes](src%2FModels%2FContracts%2FHasMediaAttributes.php)**:

[](#hasmediaattributes)

This provides some helper functions for handling media. You do not need to add traits, since the trait will be included by other traits that handle images.

#### **[HasTranslatableMedia](src%2FModels%2FContracts%2FHasTranslatableMedia.php)**:

[](#hastranslatablemedia)

If you want to support translatable media (e.g. a different image for each locale), include this interface. The implementation is done by the trait [HasTranslatedAttributesTrait.php](src%2FModels%2FConcerns%2FHasTranslatedAttributesTrait.php). The traits that implement translatable images, will make use of this implementation to keep track of the media that needs translation.

#### **[HasOverviewAttributes](src%2FModels%2FContracts%2FHasOverviewAttributes.php)**:

[](#hasoverviewattributes)

Overview fields can be used to display the content models as brief snippets in lists, for instance a list of news articles. Implement this with [HasOverviewAttributesTrait](src%2FModels%2FConcerns%2FHasOverviewAttributesTrait.php) or [HasTranslatedOverviewAttributesTrait](src%2FModels%2FConcerns%2FHasTranslatedOverviewAttributesTrait.php).

#### **[HasSEOAttributes](src%2FModels%2FContracts%2FHasSEOAttributes.php)**:

[](#hasseoattributes)

This adds a new title, description, image and keywords for SEO. It provides fallbacks to the regular title, intro and hero image if no SEO fields are completed. Implement the [HasSEOAttributesTrait](src%2FModels%2FConcerns%2FHasSEOAttributesTrait.php) or the [HasTranslatedSEOAttributesTrait](src%2FModels%2FConcerns%2FHasTranslatedSEOAttributesTrait.php) for translatable content.

#### **[Linkable](src%2FModels%2FContracts%2FLinkable.php)**:

[](#linkable)

Add this interface if you want to use the model to link in call-to-actions to create dynamic URL's, or if you want to use the view action in the Filament table. The interface asks you to implement two functions one to get the url where the content can be publicly viewed and another to view the unpublished content. There is no default implementation trait, because this package is unaware of the used routes and controllers.

#### Slugs:

[](#slugs)

For slug support you can include the [HasSlugAttributeTrait](src%2FModels%2FConcerns%2FHasSlugAttributeTrait.php) or the [HasTranslatedSlugAttributeTrait](src%2FModels%2FConcerns%2FHasTranslatedSlugAttributeTrait.php) for translatable slugs. If you use translatable slugs, please change [the page routing the Filament Resource](#resource-with-translated-slugs).

#### Parent-child content aka subpages:

[](#parent-child-content-aka-subpages)

To support hierarchical content you can include the [HasParent](src%2FModels%2FContracts%2FHasParent.php) interface and the implementation is done by [HasParentTrait](src%2FModels%2FConcerns%2FHasParentTrait.php).

If you want to implement a nested URL structure, check [this documentation](documentation%2Fparent-child.md).

### 3. Setup the Filament resource

[](#3-setup-the-filament-resource)

Create a filament resource and its page with the filament command.

#### Setup the table

[](#setup-the-table)

There are few column fields provided by the package and a filter to select published/unpublished models. Below is an overview of all available columns in a code sample:

```
public static function table(Table $table): Table {
    return $table->columns([
            TitleColumn::create(),
            PublishedColumn::create(),
        ])
        ->filters([
            PublishedFilter::create(),
        ])
        ->actions([
            Tables\Actions\EditAction::make(),
            PublishAction::make(),
            ReplicateAction::make(),
        ])
        ->bulkActions([
            Tables\Actions\DeleteBulkAction::make(),
        ]);
}
```

#### (optional) Adding a ViewAction to your table

[](#optional-adding-a-viewaction-to-your-table)

If your model uses the [`Linkable`](src%2FModels%2FContracts%2FLinkable.php) interface, you can also use the provided `ViewAction` in your table. This action will simply open the url returned by the `getViewUrl()` method on your model.

```
use Statikbe\FilamentFlexibleContentBlocks\Filament\Table\Actions\ViewAction;

->actions([
    Tables\Actions\EditAction::make(),
    PublishAction::make(),
    ViewAction::make(), // actions([
    Tables\Actions\EditAction::make(),
    PublishAction::make(),
    ReplicateAction::make(), // schema([
            Tabs::make('Heading')
                ->columnSpan(2)
                ->tabs([
                    Tab::make('General')
                        ->schema([
                            TitleField::create(true),
                            SlugField::create(),
                            PublicationSection::create(),
                            AuthorField::create(),
                            HeroImageSection::create(),
                            IntroField::create(),
                            ParentField::create(),
                        ]),
                    Tab::make('Content')
                        ->schema([
                            ContentBlocksField::create(),
                        ]),
                    Tab::make('Overview')
                        ->schema([
                            OverviewFields::make(1),
                        ]),
                    Tab::make('SEO')
                        ->schema([
                            SEOFields::make(1),
                        ]),
                ]),
        ]);
}
```

If you have translatable content, you need to include the traits and language switch field of the [`filament/spatie-laravel-translatable-plugin`](https://filamentphp.com/docs/2.x/spatie-laravel-translatable-plugin/installation) to [the resource](https://filamentphp.com/docs/2.x/spatie-laravel-translatable-plugin/getting-started#preparing-your-resource-class)and its [pages](https://filamentphp.com/docs/2.x/spatie-laravel-translatable-plugin/getting-started#making-resource-pages-translatable).
**Important:** On the edit page, you need to use the [EditRecord\\Concerns\\TranslatableWithMedia](src%2FFilament%2FPages%2FEditRecord%2FConcerns%2FTranslatableWithMedia.php) trait if you use translatable images. And on the create page use [CreateRecord\\Concerns\\TranslatableWithMedia](src%2FFilament%2FPages%2FCreateRecord%2FConcerns%2FTranslatableWithMedia.php).

####  Note on translated slugs

[](#-note-on-translated-slugs)

If you are using translated slugs on your model, it is possible that you create a new model instance without a translated slug. When you then switch to the language without a translated slug, Filament uses the slug as the route binding key as defined in the model class. This will result in an error since the slug translation does not yet exist. To solve this it is easiest to use the ID as route binding key in Filament instead of the slug. You can do this by changing the page urls in the Filament resource class, so that they do not try to resolve the object with `/{record}/edit`, but use the ID attribute `/{record:id}/edit`. Then set the `$recordRouteKeyName` of the Filament resource to `id`.

```
protected static ?string $recordRouteKeyName = 'id';

public static function getPages(): array
{
    //note: replace the page classes!
    return [
        'index' => Pages\ListArticles::route('/'),
        'create' => Pages\CreateArticle::route('/create'),
        'edit' => Pages\EditArticle::route('/{record:id}/edit'),
    ];
}
```

### 4. Setup the controller and Blade view

[](#4-setup-the-controller-and-blade-view)

Now you need to create a controller and `GET` route that returns a Blade view to display your content. See the example code for [controller examples](example%2Fapp%2FHttp).

We provide Blade components for all fields (except SEO fields). Below is an example of a simple Blade template, where the model is passed to this view as `$page` variable. The `` component renders a default hero with title and full screen image, and the `` component renders all the content of each block.

**Note:** The `x-flexible-hero` component requires [Alpine.js](https://alpinejs.dev/).

```

```

If you want to customise these component views, you can [publish the views](#installation).

You can use the SEO library of your preference to render the SEO tags on the page, e.g. with [`artesaos/seotools`](https://github.com/artesaos/seotools).

### 5. Configure tailwind

[](#5-configure-tailwind)

Do the step below to ensure that tailwind will pick up the css classes used by the flexible content blocks components.

1. In the tailwind CSS file (probably in `resources/css/filament/admin/theme.css`) of your filament back-end, add the following line:

```
@source '../../../../resources/views/filament';

```

2. Likewise, in the CSS of your front-end, add the following lines:

```
@source "../../vendor/statikbe/laravel-filament-flexible-content-blocks/**/*.blade.php";
@source "../../config/filament-flexible-content-blocks.php";

```

AI features
-----------

[](#ai-features)

We are dreaming up some exciting new AI-based features to ease content creation and translation. The first has arrived:

### SEO fields generation

[](#seo-fields-generation)

There is a form action `SEOAIAction` that generates an SEO title, description and tags based on the model's content.

To enable this, you should complete the configuration of [the OpenAI library](https://github.com/openai-php/laravel). Do not forget to run the install command:

```
php artisan openai:install

```

Create an OpenAI API key and set this up in the `.env` file of your project:

```
OPENAI_API_KEY=sk-...
OPENAI_ORGANIZATION=org-...
```

You will find the SEO AI action already set up in the `SEOFields` group.

Blocks
------

[](#blocks)

To build your content, the package provides the default blocks listed below.

### Text with image block

[](#text-with-image-block)

Additionally to the text block, you can add an image with its title and copyright. The image can be positioned left or right of the text and an image conversion and background colour of the block can be set. One can also add a call-to-action button with configured button styles. You can link to URL's, but also dynamically to other models or routes.

[![text-image.png](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/text-image.png)](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/text-image.png)

### Image block

[](#image-block)

This displays an image with copyright message and you can set image conversions, the position and the width the image should use on the page.

[![image.png](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/image.png)](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/image.png)

### Video block

[](#video-block)

You can embed videos from [numerous media services](https://github.com/dereuromark/media-embed/blob/master/docs/supported.md)and set an overlay image that will cause the video embed to be lazy loaded after clicking the image.

[![video.png](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/video.png)](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/video.png)

### Quote block

[](#quote-block)

A block to show a quote and it's author.

[![quote.png](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/quote.png)](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/quote.png)

### HTML block

[](#html-block)

A block to insert custom HTML.

[![html.png](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/html.png)](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/html.png)

### Call-to-action block

[](#call-to-action-block)

This block focuses on adding call-to-actions with image and text.

[![call-to-action.png](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/call-to-action.png)](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/call-to-action.png)

### Overview block

[](#overview-block)

This block can be used to display the overview fields and image of other model records, e.g. for displaying related blog posts. One can configure the grid columns and background colour.

[![overview-list.png](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/overview-list.png)](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/overview-list.png)

### Cards block

[](#cards-block)

This block is comparable to the overview block, however you can add the title, description, image and CTA for each card. The image conversion, background colour and grid columns can be configured.

[![cards.png](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/cards.png)](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/cards.png)

### Template block

[](#template-block)

You can select Blade templates that you want to include. This can be handy to add small forms or interactive components, e.g. a newsletter signup form or a map.

[![template.png](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/template.png)](https://raw.githubusercontent.com/statikbe/laravel-filament-flexible-content-blocks/main/documentation/img/blocks/template.png)

### Create your own custom block

[](#create-your-own-custom-block)

You can easily create your own content block by extending [AbstractContentBlock](src%2FContentBlocks%2FAbstractContentBlock.php).

**Note:** Do NOT use [AbstractFilamentFlexibleContentBlock.php](src%2FContentBlocks%2FAbstractFilamentFlexibleContentBlock.php)to extend from, because this super class contains logic to add the package's own namespace to the custom block.

Configuration
-------------

[](#configuration)

A lot of the customisation of content blocks and their behaviour can be done through the configuration file. Please, consult [the configuration documentation](documentation%2Fconfiguration.md).

Package development
-------------------

[](#package-development)

See [DEV.md](src/DEV.md)

Roadmap
-------

[](#roadmap)

Below is a list of ideas and missing features. PR's are welcome!

- Command to generate migrations, use the new [Filament Flexible Content Block Pages](https://github.com/statikbe/laravel-filament-flexible-content-block-pages)
- Command to generate models, use the new [Filament Flexible Content Block Pages](https://github.com/statikbe/laravel-filament-flexible-content-block-pages)
- Command to generate Filament resource and pages, use [Filament Flexible Content Block Pages](https://github.com/statikbe/laravel-filament-flexible-content-block-pages)
- Integrate image asset manager, see [Filament Flexible Blocks Asset Manager](https://github.com/statikbe/laravel-filament-flexible-blocks-asset-manager)
- Store links to models in rich editor
- Redirects, see
- Reusable blocks. Name: global block?
- Focal point for image resizing
- Widget to show which records do not have a translated version

Changelog
---------

[](#changelog)

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

Contributing
------------

[](#contributing)

Please, submit bugs or feature requests via the [Github issues](https://github.com/statikbe/laravel-filament-chained-translation-manager/issues). Pull requests are welcomed! Thanks!

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Sten Govaerts](https://github.com/sten)
- [Seppe Van Besauw](https://github.com/sevbesau)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance88

Actively maintained with recent releases

Popularity46

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 78.3% 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 ~12 days

Recently: every ~0 days

Total

83

Last Release

67d ago

Major Versions

v2.8.5 → v3.0.02026-02-11

v3.0.0 → v4.0.02026-02-12

v3.0.1 → v4.0.12026-02-18

v3.1.4 → v4.0.22026-03-04

v3.1.5 → v4.0.32026-03-06

PHP version history (2 changes)0.1.0PHP ^8.1

v2.2.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/1250437446b84017407f7f1900194b1e1c93fcf34b332ba382fb77f69b251cb6?d=identicon)[statikbe](/maintainers/statikbe)

---

Top Contributors

[![sten](https://avatars.githubusercontent.com/u/180665?v=4)](https://github.com/sten "sten (673 commits)")[![sevbesau](https://avatars.githubusercontent.com/u/16073039?v=4)](https://github.com/sevbesau "sevbesau (37 commits)")[![stijnelskens](https://avatars.githubusercontent.com/u/12715277?v=4)](https://github.com/stijnelskens "stijnelskens (28 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (25 commits)")[![kristofser](https://avatars.githubusercontent.com/u/5928907?v=4)](https://github.com/kristofser "kristofser (17 commits)")[![lukasdewijn](https://avatars.githubusercontent.com/u/146429694?v=4)](https://github.com/lukasdewijn "lukasdewijn (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (15 commits)")[![AurelDemiri](https://avatars.githubusercontent.com/u/30560661?v=4)](https://github.com/AurelDemiri "AurelDemiri (13 commits)")[![carolineboeykens](https://avatars.githubusercontent.com/u/42932673?v=4)](https://github.com/carolineboeykens "carolineboeykens (9 commits)")[![bverbist](https://avatars.githubusercontent.com/u/2639346?v=4)](https://github.com/bverbist "bverbist (8 commits)")[![andrii-trush](https://avatars.githubusercontent.com/u/14265776?v=4)](https://github.com/andrii-trush "andrii-trush (4 commits)")[![Sindoweb](https://avatars.githubusercontent.com/u/1379550?v=4)](https://github.com/Sindoweb "Sindoweb (4 commits)")[![Kobo-one](https://avatars.githubusercontent.com/u/11278919?v=4)](https://github.com/Kobo-one "Kobo-one (3 commits)")[![HelgeSverre](https://avatars.githubusercontent.com/u/1089652?v=4)](https://github.com/HelgeSverre "HelgeSverre (3 commits)")[![laraben](https://avatars.githubusercontent.com/u/34068668?v=4)](https://github.com/laraben "laraben (2 commits)")[![sigridviaene](https://avatars.githubusercontent.com/u/20278988?v=4)](https://github.com/sigridviaene "sigridviaene (1 commits)")[![RobbeReygel](https://avatars.githubusercontent.com/u/15078844?v=4)](https://github.com/RobbeReygel "RobbeReygel (1 commits)")

---

Tags

content-managementfilamentfilamentphplaravelphplaravelpagecmsResponsive Imageslaravel-filamentstatikbepage buildercontent builderblock builder

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/statikbe-laravel-filament-flexible-content-blocks/health.svg)

```
[![Health](https://phpackages.com/badges/statikbe-laravel-filament-flexible-content-blocks/health.svg)](https://phpackages.com/packages/statikbe-laravel-filament-flexible-content-blocks)
```

###  Alternatives

[statikbe/laravel-filament-chained-translation-manager

A translation manager tool for Laravel Filament, that makes use of the Laravel Chained Translator.

92108.7k](/packages/statikbe-laravel-filament-chained-translation-manager)[tomatophp/filament-cms

Full CMS System with support of importing integrations and multi meta functions

11410.4k4](/packages/tomatophp-filament-cms)[a2insights/filament-saas

Filament Saas for A2Insights

161.1k](/packages/a2insights-filament-saas)[tapp/filament-form-builder

User facing form builder using Filament components

131.2k1](/packages/tapp-filament-form-builder)

PHPackages © 2026

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