• Tiptap Editor

Tiptap Editor

Plugin information

by Adam Weston

Admin panel Form builder Editor

A Tiptap WYSISYG integration for Filament Admin/Forms.

Support

#tiptap on Discord

Views

6979

License

MIT

Documentation

Installation

Install the package via composer

composer require awcodes/filament-tiptap-editor

Usage

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

use FilamentTiptapEditor\TiptapEditor;
 
TiptapEditor::make('content')
->profile('simple')
->required(); //->etc

Config

Publish the config file.

php artisan vendor:publish --tag="filament-tiptap-editor-config"

Profiles

The package comes with 3 profiles for buttons out of the box.

  • default: includes all currently available tools
  • simple: 'undo', 'redo', 'bold', 'italic', 'h1', 'h2', 'h3', 'lead', 'hr', 'bulletList', 'orderedList', 'checkedList', 'link', 'media'
  • barebone: 'bold', 'italic', 'link', 'redo', 'undo'

See filament-tiptap-editor.php config file for modifying profiles to add / remove buttons from the editor.

Media / Images

  • accepted_file_types: ['image/jpeg', 'image/png', 'image/webp', 'image/svg+xml', 'application/pdf']
  • disk: 'public'
  • directory: 'images'
  • visibility: 'public'
  • preserve_file_names: false
  • max_file_size: 2042
  • image_crop_aspect_ratio: null
  • image_resize_target_width: null
  • image_resize_target_height: null
  • media_uploader_id: 'filament-tiptap-editor-media-uploader-modal'

You may also override the default file uploader with your own Livewire component and assign its ID to the media_uploader_id setting in the config file.

See vendor/awcodes/resources/views/components/media-uploader-modal.blade.php and vendor/awcodes/filament-tiptap-editor/src/Components/MediaUploaderModal.php for implementation.