PHP code example of aaix / filament-editor-js

1. Go to this page and download the library: Download aaix/filament-editor-js 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/ */

    

aaix / filament-editor-js example snippets


use Aaix\FilamentEditorJs\Forms\Components\EditorJs;
use Aaix\FilamentEditorJs\Support\HtmlRenderer\HtmlRenderer;
use Filament\Forms\Components\Placeholder;
use Filament\Schemas\Schema;
use Illuminate\Support\HtmlString;

public static function configure(Schema $schema): Schema
{
   return $schema
      ->schema([
         Tabs::make('description_tabs')
            ->tabs([
               Tab::make(__('Editor'))
                  ->schema([
                     EditorJs::make('description')
                        ->            return new HtmlString("<div style='max-width:45rem;padding:0 2rem;'>{$html}</div>");
                        }),
                  ]),
            ]),
        ]);
}

use Aaix\FilamentEditorJs\Support\HtmlRenderer\HtmlRenderer;
use App\Models\Post;
use Illuminate\Support\Facades\Route;

Route::get('/api/posts/{post}', function (Post $post) {
    return response()->json([
        'id' => $post->id,
        'title' => $post->title,
        'content_html' => HtmlRenderer::render($post->content), // Returns fully rendered HTML string
    ]);
});

use Aaix\FilamentEditorJs\Forms\Components\EditorJs;
EditorJs::make('content')
        ->imageDisk('s3') // Defaults to 'public'
        ->imageDirectory('my_photos') // Defaults to 'editorjs-images'
bash
composer  filament:assets