uni-deal/filament-relationship-builder
最新稳定版本:v1.0
Composer 安装命令:
composer require uni-deal/filament-relationship-builder
包简介
Registers a FilamentPHP builder via an Eloquent relationship with order, type, and data columns.
关键字:
README 文档
README
A simple package to register a FilamentPHP builder via an Eloquent relationship with columns: order, type, and data.
Installation
To install this package, you can use Composer directly from the GitHub repository.
Run the following command in your terminal:
composer require uni-deal/filament-relationship-builder
Once installed, you can start using the RelationshipBuilder component as shown in the example above.
Example Usage
use UniDeal\FilamentRelationshipBuilder\Components\RelationshipBuilder; RelationshipBuilder::make('blocks') ->relationship() ->blocks([ Forms\Components\Builder\Block::make('Heading')->schema([ Forms\Components\TextInput::make('content') ]) ]),
Model Requirements
The targeted model must contain a cast on the data column of type array:
class Block extends \Illuminate\Database\Eloquent\Model { // Before Laravel 11 protected $casts = [ 'data' => 'array', ]; // For Laravel 11+ protected function casts(): array { return [ 'data' => 'array', ]; } }
Register the blocks relation on the initial model:
class Post extends \Illuminate\Database\Eloquent\Model { public function blocks() { return $this->hasMany(Block::class); } }
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-16