定制 visualbuilder/filament-tinyeditor 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

visualbuilder/filament-tinyeditor

最新稳定版本:4.0.6

Composer 安装命令:

composer require visualbuilder/filament-tinyeditor

包简介

Filament TinyMce Editor v6

README 文档

README

A TineMce integration for Filament Admin/Forms.

tiny-editor

Installation

Install the package via composer

composer require visualbuilder/filament-tinyeditor

Publish assets

php artisan vendor:publish --provider="Visualbuilder\FilamentTinyEditor\TinyeditorServiceProvider"
php artisan vendor:publish --provider="Visualbuilder\FilamentTinyEditor\TinyeditorServiceProvider" --tag="config"
php artisan vendor:publish --provider="Visualbuilder\FilamentTinyEditor\TinyeditorServiceProvider" --tag="views"
php artisan vendor:publish --provider="Visualbuilder\FilamentTinyEditor\TinyeditorServiceProvider" --tag="public"

Usage

The editor extends the default Field class so most other methods available on that class can be used when adding it to a form.

use Visualbuilder\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')
	->resize('both')
	->columnSpan('full')
    ->required();

Config

The plugin will work without publishing the config, but should you need to change any of the default settings you can publish the config file with the following Artisan command:

php artisan vendor:publish --tag="filament-tinyeditor-config"

Profiles / Tools

The package comes with 4 profiles (or toolbars) out of the box. You can also use a pipe | to separate tools into groups. The default profile is the full set of tools.

'profiles' => [
    'default' => [
		'plugins' => 'accordion autoresize codesample directionality advlist link image lists preview pagebreak searchreplace wordcount code fullscreen insertdatetime media table emoticons',
		// Installing external plugins
		'external_plugins' => [
		'paste_from_word' => 'https://unpkg.com/@pangaeatech/tinymce-paste-from-word-plugin@latest/index.js'
    ],
		'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,
		// Custom Configs
		'custom_configs' => [
		'paste_webkit_styles' => 'color font-size',
    ]
	],

	'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,
	],
],

RTL Support

In order for things like text align to work properly with RTL languages you can switch the direction key in the config to 'rtl'.

// config/filament-tinyeditor.php
'direction' => 'rtl'

Versioning

This project follow the Semantic Versioning guidelines.

License

Licensed under the MIT license, see LICENSE.md for details.

统计信息

  • 总下载量: 12.78k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 36
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-26