rmitesh/builder-block

This is builder-block component for Filament

v1.0 2024-07-28 17:54 UTC

This package is auto-updated.

Last update: 2024-10-28 18:33:31 UTC


README

Latest Stable Version

Latest Stable Version Total Downloads Laravel v10.x PHP 8.1

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:

  1. Hero section (Left and right side) builder-block

  2. Cards builder-block

  3. Mini states builder-block

  4. Information boxes builder-block

  5. FAQs builder-block

Installation

You can install the package via composer:

composer require rmitesh/builder-block

How to use

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()

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.