PHP code example of rmitesh / builder-block

1. Go to this page and download the library: Download rmitesh/builder-block library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rmitesh / builder-block example snippets


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 ...
        ]);
}

BuilderBlock::make()
    ->addBlock(
        Forms\Components\Builder\Block::make('my_custom_block')
            ->columns(4)
            ->icon('heroicon-m-information-circle')
            ->schema([
                // add your form components
            ]),
    )
    ->get()

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