Provides a block builder for Filament. Blocks can be setup in the backend and rendered on the front-end.
You can install this package via composer:
composer require martin-ro/filament-blocks
php artisan make:filament-block Hero/MyHero
This will create the following Block class:
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([
//
]);
}
}
and its corresponding blade component view:
@props([
//
])
<div>
//
</div>
<x-filament-blocks::blocks :blocks="$page->blocks" />
Please see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.