cube-agency / filament-json
为 Filament 的 JSON 字段
v1.0.1
2024-03-12 16:07 UTC
Requires
- php: ^8.2
- filament/filament: ^3.0
- illuminate/contracts: ^10.0|^11.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.10|^8.1
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0|^9.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
README
基本 Filament 字段,用于以 JSON 格式保存数据
安装
您可以通过 composer 安装此包
composer require cube-agency/filament-json
使用
将 json 列添加到您的表中
$table->json('meta')->nullable();
并将此字段添加到您的表单中
use CubeAgency\FilamentJson\Filament\Forms\Components\Json; public static function form(Form $form): Form { return $form ->schema([ // ... Json::make('meta') ->schema([ Grid::make() ->schema([ TextInput::make('title'), TagsInput::make('keywords'), ]), Grid::make() ->schema([ Textarea::make('description') ->rows(3), FileUpload::make('image') ->image() ->imagePreviewHeight('64') ]), ]), // ... ]); }
测试
composer test
变更日志
请参阅 变更日志 了解最近的变化。
贡献
请参阅 贡献指南 了解详细信息。
安全漏洞
请查看 我们的安全策略 了解如何报告安全漏洞。
鸣谢
许可证
MIT 许可证(MIT)。请参阅 许可证文件 了解更多信息。