Builder Block is collection of prebuilt Builder block of Filament for the CMS pages. Everything will store in JSON format, using this data you can display content dynamically.
If you are using Filament fabricator then this is perfact package for your dynamic pages.
It comes with following blocks:
You can install the package via composer:
composer require rmitesh/builder-block
use Filament\Forms;
use Filament\Forms\Form;
use Rmitesh\BuilderBlock\Facades\BuilderBlock;
public static function form(Form $form): Form
{
return $form
->schema([
// your components ...
Forms\Components\Builder::make('content')
->blocks(
BuilderBlock::make()
->get(),
),
// your components ...
]);
}
and if you want to add your custom blocks then you can add using addBlock
function.
BuilderBlock::make()
->addBlock(
Forms\Components\Builder\Block::make('my_custom_block')
->columns(4)
->icon('heroicon-m-information-circle')
->schema([
// add your form components
]),
)
->get()
Also, you can add multiple blocks using addBlocks
function.
BuilderBlock::make()
->addBlocks([
Forms\Components\Builder\Block::make('my_custom_block_1')
->columns(4)
->icon('heroicon-m-information-circle')
->schema([
// add your form components
]),
Forms\Components\Builder\Block::make('my_custom_block_2')
->columns(4)
->icon('heroicon-m-information-circle')
->schema([
// add your form components
]),
])
->get()
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.