poldixd / laravel-filament-rich-editor-insert-html
A Filament rich editor plugin for inserting raw HTML from a modal.
Package info
github.com/poldixd/laravel-filament-rich-editor-insert-html
pkg:composer/poldixd/laravel-filament-rich-editor-insert-html
Requires
- php: ^8.2
- filament/forms: ^5.6
- illuminate/support: ^11.0 || ^12.0 || ^13.0
Requires (Dev)
- laravel/pint: ^1.19
- orchestra/testbench: ^9.0 || ^10.0 || ^11.0
- pestphp/pest: ^3.0 || ^4.0
- pestphp/pest-plugin-laravel: ^3.0 || ^4.0
README
A small Filament rich editor plugin that adds an insertHtml toolbar button. The button opens a modal where users can paste HTML, then inserts that HTML into the editor at the current cursor position.
Requirements
- PHP 8.2 or higher
- Filament Forms 5.6 or higher
- Laravel 11, 12, or 13
Installation
Install the package with Composer:
composer require poldixd/laravel-filament-rich-editor-insert-html
Laravel will discover the service provider automatically.
Usage
Register the plugin on a Filament RichEditor field:
use Filament\Forms\Components\RichEditor; use poldixd\FilamentRichEditorInsertHtml\RichEditorInsertHtmlPlugin; RichEditor::make('content') ->plugins([ RichEditorInsertHtmlPlugin::make(), ]);
The plugin automatically enables the insertHtml toolbar button. Clicking it opens a modal with an HTML textarea and inserts the submitted HTML using Filament's rich editor command API.
Translations
The package ships with English and German translations. To customize them in your application, publish the language files:
php artisan vendor:publish --tag=filament-rich-editor-insert-html-translations
The files will be published to:
lang/vendor/filament-rich-editor-insert-html
Testing
composer test
License
The MIT License (MIT).