- Can I use aequation/editorjs in Laravel instead of Symfony? If so, what’s the easiest way?
- This package is Symfony-specific and not natively compatible with Laravel due to its dependency injection and Twig integration. For Laravel, you’d need to decouple Editor.js (use CDN/npm) and manually handle backend logic like uploads and JSON storage. Alternatives like spatie/laravel-editorjs are better suited for Laravel projects.
- How do I handle file uploads with this package in Laravel if I’m not using Symfony’s VichUploaderBundle?
- The package relies on Symfony’s upload handling, which won’t work directly in Laravel. Instead, use Laravel’s filesystem (e.g., S3, local storage) or packages like laravel-filemanager. Map Symfony’s UploadedFile to Laravel’s Request->file() in your custom backend logic.
- Does this package support Laravel’s Blade templates instead of Twig?
- No, the package is Twig-centric and won’t work out-of-the-box with Blade. You’d need to rewrite Twig templates to Blade or use Inertia/Livewire to render Editor.js dynamically. The editor itself (via CDN/npm) is framework-agnostic, so Blade compatibility isn’t a blocker if you bypass the Symfony wrapper.
- What Laravel versions does this package support, or do I need to adapt it?
- This package has no Laravel support—it’s Symfony-only. If you’re using Laravel 8+, you can integrate Editor.js directly (via npm/CDN) without this package. For Laravel 5.8–7.x, you’d need to fork and rewrite Symfony-specific logic, which isn’t recommended due to maintenance overhead.
- How do I validate Editor.js JSON output in Laravel if I’m not using Symfony’s FormType?
- The package uses Symfony’s FormType for validation, which won’t translate to Laravel. Instead, validate the JSON payload in your Laravel controller or FormRequest using Laravel’s built-in validation rules (e.g., `array`, `required`). For structured schemas, use JSON casting in Eloquent models.
- Are there Laravel-specific alternatives to this package for Editor.js integration?
- Yes. For Laravel, consider spatie/laravel-editorjs (a dedicated Laravel wrapper) or a lightweight approach: load Editor.js via CDN/npm, handle uploads with Laravel Filesystem, and store JSON in a database column (e.g., `json` type or Eloquent’s `HasJson` trait).
- Can I use this package in a Laravel + Inertia.js app for rich-text editing?
- Not directly—the package is Symfony-focused. For Inertia.js, integrate Editor.js via npm (e.g., `@editorjs/editorjs`), handle API calls from Inertia, and process JSON in Laravel controllers. The package’s Symfony abstractions (e.g., Twig, DI) won’t apply.
- How do I configure custom Editor.js tools (e.g., tables, code blocks) in Laravel without this package?
- Editor.js tools are configured via JavaScript. If using CDN/npm, initialize the editor with your tools array in your Blade/JS file. For backend processing, validate the JSON output in Laravel and store it as-is or transform it (e.g., into HTML) before saving to the database.
- What’s the performance impact of using this package in Laravel via a forked version?
- Forking and adapting this package for Laravel introduces technical debt. The package itself is lightweight, but Symfony dependencies (e.g., DI, Twig) add complexity. For performance, prioritize direct Editor.js integration (CDN/npm) with Laravel’s asset optimization (Vite/Mix) to avoid bloat.
- Does this package handle database storage of Editor.js JSON content, and how would I replicate that in Laravel?
- The package likely stores Editor.js JSON in Symfony’s Doctrine ORM. In Laravel, replicate this by saving the JSON to a `json` column in MySQL or using Eloquent’s `HasJson` trait. For validation, use Laravel’s model casts or custom accessors to ensure data integrity.