nasirkhan/laravel-jodit
Laravel Jodit integrates the Jodit WYSIWYG editor into Laravel via a reusable Blade component that works in Blade and Livewire. Includes a server-side file browser/uploader connector, CDN-loaded assets, and publishable config for toolbar, disks, paths, and middleware.
composer require nasirkhan/laravel-jodit
@stack('after-styles')
@stack('after-scripts')
<x-jodit::editor name="content" :value="$post->content" />
For a Livewire component, sync the editor with a property:
<x-jodit::editor name="description" wire-model="description" />
The editor will automatically debounce updates (default: 300ms) to avoid excessive Livewire syncs.
name and value props:
<x-jodit::editor name="bio" :value="old('bio', $user->bio)" />
<x-jodit::editor name="excerpt" :file-browser="false" />
<x-jodit::editor name="content" wire-model="postContent" />
<x-jodit::editor name="content" wire-model="content" :debounce="500" />
<x-jodit::editor name="content" profile="full" />
$buttons = ['bold', 'italic', '|', 'link', 'image'];
<x-jodit::editor name="content" :buttons="$buttons" />
<x-jodit::editor name="content" connector-url="{{ route('admin.jodit.connector') }}" />
config/jodit.php:
'disk' => 's3',
'base_path' => 'uploads/jodit',
@stack('after-styles') and @stack('after-scripts') exist in your layout.wire:ignore is auto-applied (it is by default).storage/disk and base_path in config. Ensure the directory exists:
php artisan storage:link
'cdn_css' => 'https://your-cdn/jodit.min.css',
'route' => ['enabled' => false],
Then register your own route in routes/web.php.Nasirkhan\LaravelJodit\Http\Controllers\JoditConnectorController.protected $listeners = ['jodit:updated' => 'handleEditorUpdate'];
debounce for large editors to reduce sync overhead.@push('after-scripts')
@if(request()->routeIs('editor-page'))
<script src="https://unpkg.com/jodit@4.1.16/es2021/jodit.min.js"></script>
@endif
@endpush
web middleware (default in config).max_file_size in config if uploads fail:
'max_file_size' => 5120, // 5MB
height).defaultActionOnPaste: 'insert_clear_html' in config to sanitize pasted content..jodit-wrapper {
--jodit-bg-color: #2d3748;
--jodit-text-color: #e2e8f0;
}
intervention/image-laravel for resize/crop features:
composer require intervention/image-laravel
Then configure in config/jodit.php:
'image_driver' => 'gd', // or 'imagick'
```markdown
---
How can I help you explore Laravel packages today?