PHP code example of martin-ro / filament-blocks

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


use Filament\Forms\Components\Builder\Block;
use MartinRo\FilamentBlocks\PageBlock;
 
class MyHero extends FilamentBlock
{
    public static function getBlockSchema(): Block
    {
        return Block::make('hero.my-hero')
            ->label('Hero: My Hero')
            ->icon('heroicon-o-rectangle-stack')
            ->preview('components.blocks.hero.my-hero')
            ->schema([
                //
            ]);
    }
}