martin-ro / filament-blocks
Installs: 48
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/martin-ro/filament-blocks
Requires
- php: ^8.3
- filament/filament: ^3.2
- illuminate/contracts: ^10.0 | ^11.0
- ryangjchandler/filament-navigation: ^1.0@beta
- spatie/laravel-package-tools: ^1.16.4
Requires (Dev)
- laravel/pint: ^1.17
README
Provides a block builder for Filament. Blocks can be setup in the backend and rendered on the front-end.
Installation
You can install this package via composer:
composer require martin-ro/filament-blocks
Creating a Block
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>
Using Blocks in your template
<x-filament-blocks::blocks :blocks="$page->blocks" />
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.