jkharley / filament-trumbowyg
Trumbowyg wysiwyg editor field for Filament.
Fund package maintenance!
JKHarley
Installs: 1 437
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 1
Forks: 2
Open Issues: 3
Requires
- php: ^8.0
- filament/filament: ^3.0
- illuminate/contracts: ^9.0|^10.0
- spatie/laravel-package-tools: ^1.13.5
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0|^8.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- pestphp/pest-plugin-livewire: ^1.0
- pestphp/pest-plugin-parallel: ^0.3
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2025-04-29 01:38:24 UTC
README
Trumbowyg wysiwyg editor field for Filament.
Disclaimer
Warning: This field does not work with the Filament block builder. I'm actively trying to make this compatible and will hopefully have an update in the near future. The WYSIWYG default theme may also not work as expected in some cases with the Filament 3 theming. If you're using Filament in light mode make sure to set
reset_css
tofalse
in thefilament-trumbowyg.php
config in a future update I will be adding the ability to customise the WYSIWYG theme.
Installation
You can install the package via composer:
composer require jkharley/filament-trumbowyg
Usage
use JKHarley\FilamentTrumbowyg\Trumbowyg; Trumbowyg::make('my-field')
Buttons Pane Customisation
You can customise the buttons pane by passing an array of buttons to the buttons key in the filament-trumbowyg
config file. This will overwrite the default buttons pane set by Trumbowyg and will be used across all Trumbowyg
fields.
php artisan vendor:publish --tag="filament-trumbowyg-config"
// config/filament-trumbowyg.php 'buttons' => [ ['undo', 'redo'], ['strong', 'em', 'del'], 'link', 'fullscreen', ]
Alternatively you can pass an array of buttons to the buttons
method on the field.
You can also use this to overwrite the buttons set in the config file for a specific field.
Trumbowyg::make('my-field') ->buttons([ ['undo', 'redo'], ['strong', 'em', 'del'], 'link', 'fullscreen', ]),
Basic Options
Most options under the basic options
selection on the Trumbowyg website are supported with this field. Each option can be added as a chained method on the field or all fields can default to a value set in the config file. Here are the options that can be passed with an example value:
Trumbowyg::make('my-field') ->tagClasses([]) ->changeActiveDropdownIcon(true) ->removeFormatPasted(true) ->tagsToRemove(['script']) ->tagsToKeep([]) ->minimalLinks(true) ->linkTargets(['_self']) ->imageWidthModalEdit(true) ->urlProtocol('ftp')
Future Additions
- Localization
- Theme customisation
- SVG icon customisation
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.