PHP code example of martin-ro / filament-page-blocks

1. Go to this page and download the library: Download martin-ro/filament-page-blocks 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/ */

    

martin-ro / filament-page-blocks example snippets


use Filament\Forms\Components\Builder\Block;
use MartinRo\FilamentPageBlocks\PageBlock;
 
class MyBlock extends PageBlock
{
    public static function getBlockSchema(): Block
    {
        return Block::make('my-page-block')
            ->label('My Page Block')
            ->icon('heroicon-o-rectangle-stack')
            ->schema([
                //
            ]);
    }
 
    public static function mutateData(array $data): array
    {
        return $data;
    }
}