Download the PHP package hosseinesteki/filament-editorjs without Composer
On this page you can find all versions of the php package hosseinesteki/filament-editorjs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hosseinesteki/filament-editorjs
More information about hosseinesteki/filament-editorjs
Files in hosseinesteki/filament-editorjs
Package filament-editorjs
Short Description This is my package filament-editorjs
License MIT
Informations about the package filament-editorjs
Filament EditorJS
A premium EditorJS field for Filament with seamless Spatie Media Library integration and a robust rendering system.
Filament EditorJS brings the power of Editor.js to your Filament admin panel, allowing you to create rich, block-based content with ease. It handles image uploads out of the box using Livewire and Spatie's Media Library, and provides a powerful rendering engine to display your content on the frontend with Tailwind CSS support.
โจ Features
- ๐ Zero-Config Uploads: Effortless image uploads using Filament's internal file attachment system.
- ๐ฆ Spatie Media Library: Full integration for managing your content assets.
- ๐ ๏ธ Dynamic Plugin System: Easily add and configure both built-in and custom Editor.js tools.
- ๐จ Tailwind Rendering: Built-in support for rendering content with Tailwind Typography (
prose). - โก Filament v5 Ready: Fully compatible with the latest Filament v4 and v5 features.
- ๐งฉ Extensible Blocks: Create custom renderers for your unique block types in PHP.
- ๐ Automatic Cleanup: Automatically manages and cleans up unused media attachments.
๐ Installation
Install the package via composer:
Publish the configuration file:
๐ฅ Quick Start
1. Prepare your Model
Your model must implement Spatie's HasMedia interface and use the ModelHasEditorJsComponent trait provided by this package.
2. Register the Plugin (Optional but recommended for v4/v5)
Add the plugin to your Filament Panel provider (usually AdminPanelProvider.php):
3. Add to your Filament Resource
Simply use the EditorjsTextField in your form schema:
4. Render on the Frontend
Displaying your content is just as easy:
Note: For the best experience, ensure you have the @tailwindcss/typography plugin installed.
๐ ๏ธ Dynamic Plugin System
This package allows you to customize the editor tools dynamically.
Adding Custom Tools
You can add any Editor.js compatible tool by registering it in Javascript and then enabling it in PHP.
1. Register in Javascript
Add your custom tool to the global window.filamentEditorJsTools registry:
2. Enable in PHP
Use the addPlugin method on your field:
๐จ Customizing Content Rendering
You can extend the rendering engine by adding custom renderers for specific block types.
Creating a Custom Renderer
Registering your Renderer
Register it in your AppServiceProvider:
โ๏ธ Configuration
The config/filament-editorjs.php file allows you to define different tool profiles:
Switch between profiles in your form:
๐ Upgrading
Please refer to the Upgrade Guide when moving between major versions.
๐งช Testing
๐ค Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
๐ License
The MIT License (MIT). Please see License File for more information.
All versions of filament-editorjs with dependencies
filament/filament Version ^4.5|^5.0
filament/spatie-laravel-media-library-plugin Version ^v4.0|^5.0