Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mce Media Bundle Laravel Package

elao/mce-media-bundle

Symfony bundle integrating TinyMCE Image Manager/File Manager. Adds an “asset” input type with upload button, image preview, and stored path. Supports configurable labels/icons/sizes plus external authentication and role/secret key access control.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Legacy Compatibility: The bundle is designed for Symfony 2.x (Laravel 5.x/6.x compatibility is untested) and integrates with TinyMCE 3.x/4.x (now deprecated). Modern Laravel apps (v8+) use TinyMCE 5/6 or alternatives like CKEditor or Quill, requiring a rewrite or polyfill for core functionality.
  • Monolithic Design: Tight coupling with Symfony’s dependency injection and Doctrine may necessitate abstraction layers (e.g., service containers, facades) to adapt to Laravel’s ecosystem.
  • Media Handling: Assumes Symfony’s file storage (e.g., Flysystem, Swiftmailer). Laravel’s Storage facade or Spatie Media Library would need alignment for file/image management.

Integration Feasibility

  • TinyMCE Version Gap: TinyMCE 4.x plugins (e.g., filemanager, imagemanager) are incompatible with modern TinyMCE 5/6 APIs. A plugin migration or custom bridge (e.g., using TinyMCE’s plugins config) would be required.
  • Laravel-Specific Challenges:
    • Routing: Symfony’s routing component must be replaced with Laravel’s Route service provider.
    • Asset Management: TinyMCE assets (JS/CSS) would need Laravel Mix/Vite integration or manual CDN inclusion.
    • Authentication: Symfony’s security system (e.g., SecurityContext) must map to Laravel’s Auth or Gate system.
  • Database Agnosticism: Doctrine ORM dependencies (e.g., EntityManager) would need Eloquent equivalents or a data mapper pattern.

Technical Risk

Risk Area Severity Mitigation
TinyMCE Version Incompatibility High Rewrite plugins or use a compatibility layer (e.g., tinymce/tinymce npm package).
Symfony-Laravel Abstraction Medium Create adapter classes for DI, routing, and auth.
Deprecated Dependencies Medium Replace Symfony 2.x components with Laravel equivalents (e.g., Psr-15 middleware).
No Active Maintenance High Fork the repo or build a minimal viable integration.
File/Image Storage Assumptions Medium Standardize on Laravel’s Storage facade or Spatie Media Library.

Key Questions

  1. Is TinyMCE 4.x support a hard requirement? If not, consider modernizing to TinyMCE 5/6 with native file/image plugins.
  2. What’s the current media storage backend? (e.g., S3, local filesystem) – Alignment with Laravel’s Storage is critical.
  3. Are there existing TinyMCE plugins (e.g., tinymce-image-upload) that could replace this bundle?
  4. What’s the team’s PHP/Symfony expertise? A rewrite may require Symfony/Laravel hybrid development skills.
  5. Is there a need for Symfony’s event system? If so, Laravel’s Events service provider can substitute.

Integration Approach

Stack Fit

  • Laravel Compatibility:
    • TinyMCE: Use tinymce/tinymce (npm) for v5/6, or polyfill v4 plugins via custom JS.
    • File/Image Management: Replace Symfony’s Flysystem with Laravel’s Storage or Spatie Media Library.
    • Authentication: Map Symfony’s SecurityContext to Laravel’s Auth::user() or Gate policies.
    • Routing: Replace Symfony’s router with Laravel’s Route::get() or API routes.
  • Dependency Replacement:
    Symfony Component Laravel Equivalent
    Doctrine EntityManager Eloquent ORM (App\Models\Media)
    Swiftmailer Laravel’s Mail facade
    Symfony EventDispatcher Laravel’s Event service provider
    Twig Blade templates or Laravel’s view layer

Migration Path

  1. Assessment Phase:
    • Audit current TinyMCE/Symfony integration points.
    • Decide: Fork + Modernize (recommended) or Isolate (wrap in a service layer).
  2. Phase 1: TinyMCE Upgrade
    • Migrate to TinyMCE 5/6 via npm (tinymce/tinymce).
    • Replace filemanager/imagemanager plugins with:
      • Custom endpoints (e.g., /api/upload) using Laravel’s FormRequest.
      • Frontend JS to trigger uploads via fetch() or Axios.
  3. Phase 2: Symfony-Laravel Bridge
    • Create a Laravel service provider to:
      • Register TinyMCE config (e.g., config/tinymce.php).
      • Map Symfony’s MceMediaBundle services to Laravel’s container.
    • Example:
      // app/Providers/MceMediaServiceProvider.php
      public function register() {
          $this->app->singleton('mce.media.manager', function () {
              return new LaravelMediaManager(); // Custom implementation
          });
      }
      
  4. Phase 3: File/Image Storage
    • Replace Symfony’s storage with Laravel’s Storage::disk() or Spatie Media Library.
    • Example upload endpoint:
      // routes/api.php
      Route::post('/upload', [MediaController::class, 'upload']);
      
  5. Phase 4: Testing & Deprecation
    • Write Pact tests to verify Symfony-Laravel contract.
    • Gradually replace bundle usage with native Laravel patterns.

Compatibility

  • TinyMCE Plugins: The original filemanager/imagemanager plugins are TinyMCE 4.x-specific. Solutions:
    • Use TinyMCE 5’s built-in image upload (docs).
    • Build a custom plugin using TinyMCE 5’s Plugin API.
  • Symfony Services: Highly coupled services (e.g., MceMediaManager) will require wrapper classes to abstract Symfony dependencies.
  • Database Schema: If using Doctrine entities, migrate to Eloquent models with matching fields (e.g., id, url, mime_type).

Sequencing

  1. Short-Term (2-4 weeks):
    • Set up TinyMCE 5/6 with basic upload functionality.
    • Replace Symfony’s file storage with Laravel’s Storage.
  2. Medium-Term (4-8 weeks):
    • Build adapter layer for MceMediaBundle services.
    • Test authentication and permission flows.
  3. Long-Term (8+ weeks):
    • Deprecate bundle usage; migrate to native Laravel patterns.
    • Optimize performance (e.g., queue uploads, CDN integration).

Operational Impact

Maintenance

  • Forking Risk: Since the original bundle is archived, any fixes or updates will require local maintenance.
  • Dependency Bloat: Symfony components (e.g., Doctrine, Swiftmailer) add unnecessary overhead in a Laravel stack.
  • Recommendation:
    • Minimal Fork: Only extract core media-handling logic.
    • Laravel-Native: Prefer Spatie Media Library or custom solutions for long-term viability.

Support

  • Community: No active support; issues must be resolved internally.
  • Debugging: Symfony-specific errors (e.g., SecurityContext) will require cross-stack debugging.
  • Workaround: Use Laravel’s built-in tools (e.g., telescope, laravel-debugbar) for logging and monitoring.

Scaling

  • Performance:
    • TinyMCE 4.x plugins may introduce legacy JS overhead.
    • File uploads should use queued jobs (laravel-queue) for scalability.
  • Database:
    • Eloquent models should support indexes on frequently queried fields (e.g., mime_type, user_id).
  • Storage:
    • Offload media to S3/Cloud Storage with Laravel’s Storage facade.

Failure Modes

Failure Scenario Impact Mitigation
TinyMCE Plugin JS Errors Broken editor UI Fallback to basic TinyMCE config; log errors via Sentry.
File Upload Failures Corrupted media Validate uploads with Validator; use Storage::put() with checksums.
Symfony-Laravel Service Collision
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope
nawasara/auth-primitives
adhocrat-io/arkhe-main
make-dev/orca-harpoon
itsemon245/lamet
baks-dev/dashboard
amoifr/pickle-panther-bundle
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle