PHP code example of proho / filament-tiptap-editor

1. Go to this page and download the library: Download proho/filament-tiptap-editor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

proho / filament-tiptap-editor example snippets


use FilamentTiptapEditor\TiptapEditor;

TiptapEditor::make('content')
    ->profile('default|simple|barebone|custom')
    ->tools([]) // individual tools to use in the editor, overwrites profile
    ->disk('string') // optional, defaults to config setting
    ->directory('string or Closure returning a string') // optional, defaults to config setting
    ->acceptedFileTypes(['array of file types']) // optional, defaults to config setting
    ->maxFileSize('integer in KB') // optional, defaults to config setting
    ->output('json') // optional, change the output format. defaults is html
    ->maxContentWidth('5xl')
    ->

    TiptapEditor::make('content')
        // ... other options
        ->output(FilamentTiptapEditor\TiptapEditor::OUTPUT_JSON);

    TiptapEditor::make('content')
        // ... other options
        ->output('json');

   $table->json('content');

[
    'direction' => 'rtl'
    ...
]

[
    'max_content_width' => 'full'
    ...
]

use FilamentTiptapEditor\TiptapEditor;

TiptapEditor::make('content')
    ->maxContentWidth('3xl');

TiptapEditor::make('barebone')
    ->profile('barebone')
    ->extraInputAttributes(['style' => 'min-height: 12rem;']),

TiptapEditor::make('content')
    ->disableFloatingMenus()
    ->disableBubbleMenus();

[
    'disable_floating_menus' => true,
    'disable_bubble_menus' => true,
    ...
]

TiptapEditor::make('content')
    ->floatingMenuTools(['grid-builder', 'media', 'link'])

[
    ...
    'floating_menu_tools' => ['media', 'grid', 'grid-builder', 'details', 'table', 'oembed', 'code-block']
]

<form wire:submit.prevent="submit">
    {{ $this->form }}

    <button type="submit">
        Save
    </button>
</form>

{{ $this->modal }}
blade
{!! tiptap_converter()->asHTML($post->content) !!}
{!! tiptap_converter()->asJSON($post->content) !!}
{!! tiptap_converter()->asText($post->content) !!}
bash
php artisan vendor:publish --tag="filament-tiptap-editor-config"
js
content: [
    ...
    "./vendor/awcodes/filament-tiptap-editor/resources/views/**/*.blade.php",
],