- Can I use this bundle directly in Laravel without Symfony?
- No, this bundle is designed for Symfony 2.x and tightly couples with its components like Doctrine and routing. You’d need to create adapter layers (e.g., service providers, facades) to bridge Symfony’s dependency injection and Laravel’s ecosystem. TinyMCE 4.x support also requires modernizing to TinyMCE 5/6 or using polyfills.
- What Laravel versions does this bundle support?
- This bundle is untested in Laravel. It assumes Symfony 2.x, which aligns loosely with Laravel 5.x/6.x but lacks compatibility with Laravel 8+. For Laravel 8+, you’d need to rewrite core functionality or use alternatives like Spatie Media Library or TinyMCE 5/6 plugins.
- How do I integrate TinyMCE 5/6 with this bundle?
- The bundle relies on TinyMCE 4.x plugins (filemanager/imagemanager), which are incompatible with TinyMCE 5/6. You’d need to replace them with modern plugins (e.g., `tinymce-image-upload`) or build custom endpoints in Laravel (e.g., `/api/upload`) using Axios/fetch. The frontend JS would trigger these endpoints instead of the deprecated plugins.
- What’s the best way to handle file/image storage in Laravel?
- The bundle assumes Symfony’s Flysystem for storage, but Laravel uses its own `Storage` facade or libraries like Spatie Media Library. Replace Symfony’s storage logic with Laravel’s `Storage::disk()->put()` or Spatie’s `Media` model to manage uploads, thumbnails, and paths. Ensure your TinyMCE config points to Laravel’s storage paths.
- How do I configure the asset input field in Laravel?
- The bundle’s asset input requires `/bundles/elaomcemedia/js/input_asset.js` and TinyMCE plugins, which won’t work natively in Laravel. Instead, use TinyMCE 5/6’s native image upload plugins or replicate the functionality with custom JS. For example, use a file input + preview div, then save the path via Laravel’s `Storage` facade when the form submits.
- Is there role-based access control for the Image/File Manager?
- Yes, the bundle supports role-based access via Symfony’s `SecurityContext`. In Laravel, map this to Laravel’s `Gate` or `Auth::user()->hasRole()`. Configure the `secret_key` in your Laravel config (e.g., `config/tinymce.php`) and ensure your TinyMCE 5/6 plugins validate this key via a custom endpoint (e.g., `/api/tinymce/auth`).
- What are the alternatives to this bundle for Laravel?
- For Laravel, consider: **Spatie Media Library** (for file/image management), **TinyMCE 5/6 with `tinymce-image-upload` plugin** (for WYSIWYG + uploads), or **Laravel Filemanager** (open-source Symfony-inspired package). These avoid Symfony dependencies and integrate natively with Laravel’s routing, auth, and storage systems.
- How do I migrate from Symfony’s routing to Laravel’s?
- Symfony’s routing must be replaced with Laravel’s `Route::get()` or API routes. For TinyMCE’s file/image manager endpoints (e.g., `/_tinymce/login`), create Laravel routes that handle authentication and file operations. Use middleware like `auth:sanctum` or `can:upload-media` to secure these routes.
- Does this bundle support customizing the asset input UI?
- The bundle allows customization of icons (`delete_image`, `pick_up_image`), labels, and preview size via JS. In Laravel, you’d replicate this with TinyMCE 5/6’s plugin options or custom HTML/CSS. For example, use TinyMCE’s `setup` callback to inject your UI elements and handle uploads via Laravel endpoints.
- What’s the maintenance status of this bundle?
- The bundle is unmaintained and tied to deprecated Symfony 2.x/TinyMCE 4.x. For production use, fork the repo and modernize it for Laravel/TinyMCE 5/6, or replace it entirely with Laravel-native solutions. Check the GitHub repo for the last commit (2016) and consider community forks or alternatives.