ghost / ckeditor
CKEditor 5 集成到laravel-admin
v1.0.1
2020-04-22 15:50 UTC
Requires
- php: >=7.0.0
- encore/laravel-admin: ~1.6
Requires (Dev)
- phpunit/phpunit: ~6.0
This package is auto-updated.
Last update: 2024-09-23 01:40:42 UTC
README
安装
composer require ghost/ckeditor
然后
php artisan vendor:publish --tag=ghost-ckeditor
配置
在 config/admin.php
文件的 extensions
部分添加属于此扩展的配置。
'ckeditor' => [ //Set to false if you want to disable this extension 'enable' => true, // Editor configuration 'config' => [ "simpleUpload"=>[ "uploadUrl"=>'/admin/uploads' ], "fontSize" => [ "options" =>[ 9, 11, 13, 'default', 17, 19, 21 ] ], "toolbar"=>[ "items"=>[ 'heading', 'fontFamily', 'fontSize', 'fontColor', 'fontBackgroundColor', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'indent', 'outdent', '|', 'imageUpload', 'blockQuote', 'insertTable', 'mediaEmbed', 'undo', 'redo' ] ], 'image'=>[ 'toolbar'=>['imageTextAlternative', '|', 'imageStyle:alignLeft', 'imageStyle:full', 'imageStyle:alignRight'], 'resizeUnit'=>'px', 'styles'=>[ // This option is equal to a situation where no style is applied. 'full', 'side', // This represents an image aligned to the left. 'alignLeft', 'alignCenter', // This represents an image aligned to the right. 'alignRight' ] ], "table" =>[ 'contentToolbar'=>[ 'tableColumn', 'tableRow', 'mergeTableCells' ] ], 'language'=>'zh-cn', ] ]
使用方法
Form::extend('editor', \ghost\CKEditor\Editor::class);