martin-ro / filament-page-blocks
Block-Based Page Builder Skeleton for Filament Apps
1.0.6
2024-04-19 01:55 UTC
Requires
- php: ^8.2
- filament/filament: ^3.0-stable
- illuminate/contracts: ^10.0 | ^11.0
- spatie/laravel-package-tools: ^1.13.5
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.0
- spatie/laravel-ray: ^1.26
README
This is basically a lightweight version of Z3d0X's excellent Filament Fabricator Plugin.
It only provides the blocks functionality without layouts, pages, routing, etc.
Installation
You can install this package via composer:
composer require martin-ro/filament-page-blocks
Documentation
Documentation can be viewed at: https://filamentphp.com/plugins/fabricator
Creating a Page Block
php artisan make:filament-page-block MyPageBlock
This will create the following Page Block class:
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; } }
and its corresponding blade component view:
<div> // </div>
Using Page Blocks in your template
<x-filament-page-blocks::page-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.