abdelhamiderrahmouni/filament-editorjs

Next generation block styled editor.
2,462 1
Install
composer require abdelhamiderrahmouni/filament-editorjs
Latest Version:v0.1.0
PHP:^8.1
License:MIT
Last Updated:Jun 16, 2024
Links: GitHub  ·  Packagist
Maintainer: abdelhamiderrahmouni

Filament EditorJs

Filament EditorJs Latest Version on Packagist Total Downloads

EditorJs integration for Filament Admin/Forms.

Installation

You can install the package via composer:

composer require abdelhamiderrahmouni/filament-editorjs

Usage

use FilamentEditorJs\Forms\Components\EditorJs;

EditorJs::make('content')

Customization

Tools

By default all tools are enabled. This is a list of available tools:

[
    'attaches',         // @editorjs/attaches
    'checklist',        // @editorjs/checklist
    'code',             // @editorjs/code
    'delimiter',        // @editorjs/delimiter
    'header',           // @editorjs/header
    'image-gallery',    // editorjs-gallery
    'image',            // @editorjs/image
    'inline-code',      // @editorjs/inline-code
    'link',             // @editorjs/link
    'list',             // @editorjs/list
    'marker',           // @editorjs/marker
    'nested-list',      // @editorjs/nested-list
    'paragraph',        // @editorjs/paragraph
    'quote',            // @editorjs/quote
    'raw',              // @editorjs/raw
    'style',            // editorjs-style
    'table',            // @editorjs/table
    'underline',        // @editorjs/underline
    'warning',          // @editorjs/warning
]

You can disable any of them using by passing an array of tool names:

EditorJs::make('content')
    ->disableTools(['image', 'raw']);

Also you can enable only certain tools:

EditorJs::make('content')
    ->tools(['image', 'raw']);

Tools Options

You can pass options to the tools:

EditorJs::make('content')
    ->toolsOptions([
        'attaches' => [
            'endpoint' => '/upload/file',
        ],
        'image' => [
            'endpoints' => [
                'byFile' => '/upload/image',
                'byUrl' => '/upload/image-by-url',
            ],
        ],
    ]);

Debugging

To debug the editor, you can enable the debug mode:

EditorJs::make('content')
    ->debug();

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.

Related Packages

athphane/filament-editorjs

This is my package filament-editorjs

6,585 18
tightenco/ziggy

Use your Laravel named routes in JavaScript.

56,920,205 4,320
spatie/shiki-php

Highlight code using Shiki in PHP

29,216,714 315
spatie/laravel-web-tinker

Artisan Tinker in your browser

4,453,490 1,218
malzariey/filament-daterangepicker-filter

This package uses daterangepciker library to filter date by a range or predefine...

3,011,647 178

Version History

Version Released PHP Laravel License
v0.1.0 ^8.1 ^10.0|^11.0 MIT