codeisawesomehq / filament-tinyeditor
Filament TinyMce Editor v6
1.4.7
2023-11-05 21:33 UTC
Requires
- php: ^8.1
- spatie/laravel-package-tools: ^1.16
README
为 TinyMce 提供与 Filament Admin/Forms 的集成。
安装
使用composer安装此包
composer require codeisawesomehq/filament-tinyeditor
用法
编辑器扩展了默认的Field类,因此将编辑器添加到表单时,可以在此类上使用大部分其他方法。
use CodeIsAwesome\FilamentTinyEditor\TinyEditor; TinyEditor::make('content') ->fileAttachmentsDisk('public') ->fileAttachmentsVisibility('public') ->fileAttachmentsDirectory('uploads') ->profile('default|simple|full|minimal|none|custom') ->rtl() // Set RTL or use ->direction('auto|rtl|ltr') ->columnSpan('full') ->required();
配置
插件不需要发布配置即可运行,但如果您需要更改任何默认设置,可以使用以下Artisan命令发布配置文件
php artisan vendor:publish --tag="filament-tinyeditor-config"
配置文件 / 工具
此包自带4个配置文件(或工具栏)。您还可以使用竖线 |
将工具分组。默认配置文件包含所有工具。
'profiles' => [ 'default' => [ 'plugins' => 'accordion autoresize codesample directionality advlist link image lists preview pagebreak searchreplace wordcount code fullscreen insertdatetime media table emoticons', 'toolbar' => 'undo redo removeformat | styles | bold italic | rtl ltr | alignjustify alignright aligncenter alignleft | numlist bullist outdent indent | forecolor backcolor | blockquote table toc hr | image link media codesample emoticons | wordcount fullscreen', 'upload_directory' => null, ], 'simple' => [ 'plugins' => 'autoresize directionality emoticons link wordcount', 'toolbar' => 'removeformat | bold italic | rtl ltr | numlist bullist | link emoticons', 'upload_directory' => null, ], 'minimal' => [ 'plugins' => 'link wordcount', 'toolbar' => 'bold italic link numlist bullist', 'upload_directory' => null, ], 'full' => [ 'plugins' => 'accordion autoresize codesample directionality advlist autolink link image lists charmap preview anchor pagebreak searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media table emoticons template help', 'toolbar' => 'undo redo removeformat | styles | bold italic | rtl ltr | alignjustify alignright aligncenter alignleft | numlist bullist outdent indent accordion | forecolor backcolor | blockquote table toc hr | image link anchor media codesample emoticons | visualblocks print preview wordcount fullscreen help', 'upload_directory' => null, ], ],
右对齐支持
为了使文本对齐等属性在右对齐语言中正常工作,可以将配置中的 direction
键更改为 'rtl'。
// config/filament-tinyeditor.php 'direction' => 'rtl'
版本控制
本项目遵循 语义化版本控制 指南。
许可证
在MIT许可证下授权,有关详细信息,请参阅 LICENSE.md。