- How do I integrate Jodit into a plain Blade template?
- Simply include the Blade component `<x-jodit::editor name='content' />` in your view. The package auto-loads CDN assets, so no manual JS/CSS setup is needed. For customization, publish the config with `php artisan vendor:publish --tag=jodit` and adjust toolbar buttons or storage settings.
- Does Laravel Jodit work with Livewire, and how?
- Yes, it fully supports Livewire via `wire-model`. Use `<x-jodit::editor wire:model='post.content' />` in your Livewire component. The editor syncs automatically with a 300ms debounce delay. For real-time editing, adjust the debounce value or wrap the editor in `wire:ignore` and manually sync via JavaScript.
- What Laravel versions does this package support?
- The package supports Laravel 11, 12, and 13. It requires PHP 8.2 or higher. Check the [Packagist page](https://packagist.org/packages/nasirkhan/laravel-jodit) for the latest version compatibility. No service provider registration is needed—it’s auto-discovered.
- How do I configure file uploads and storage?
- File uploads are handled by a built-in connector controller. Configure the storage disk (e.g., `public`, `s3`) and upload path in `config/jodit.php`. For image resizing, install `intervention/image-laravel` (~1MB dependency). The connector uses Laravel’s filesystem, so you can leverage any supported disk.
- Can I self-host Jodit’s CSS/JS instead of using the CDN?
- Yes, publish the config (`php artisan vendor:publish --tag=jodit`) and update the `cdn` array in `config/jodit.php` to point to your local paths. This avoids CDN dependency risks but requires manual asset management. Self-hosting is recommended for production-critical applications.
- What if I need custom toolbar buttons or plugins?
- The package supports custom toolbar configurations. Publish the config and modify the `toolbar` array in `config/jodit.php`. You can add buttons like `embed`, `table`, or custom dropdowns. For advanced plugins, check Jodit’s [official documentation](https://xdsoft.net/jodit/doc/) and extend the editor via the `events` config option.
- Are there security risks with file uploads?
- The connector includes basic middleware (web + auth) by default. For stricter security, publish the config and add `throttle`, `validate`, or `signed` middleware to the `connector.middleware` array. Validate file types and sizes in the `upload` config, and consider adding virus scanning if needed.
- How do I handle concurrent file uploads in production?
- The connector includes built-in throttling to handle concurrent uploads. For high-traffic apps, monitor performance and adjust the `throttle` middleware in the config. For horizontal scaling, consider queueing uploads using Laravel Queues or offload processing to a separate service.
- What are the alternatives to Laravel Jodit?
- Alternatives include `spatie/laravel-medialibrary` (for file management) paired with TinyMCE or CKEditor, or `unisharp/laravel-ckeditor` for a CKEditor integration. However, Laravel Jodit stands out for its seamless Livewire integration and Blade-first design, reducing boilerplate for rich-text editing.
- Does this package work with Laravel View Components?
- Yes, the package is designed to work with Laravel’s View Components. Use `<x-jodit::editor />` directly in your component class’s view. The editor’s configuration (toolbar, storage) is centralized, so you can reuse it across multiple components without duplication.