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

Ux Quill Laravel Package

ehyiah/ux-quill

Symfony UX bundle integrating the Quill.js WYSIWYG editor. Drop-in QuillType form field with multiple editors per page, works with AssetMapper or Webpack Encore, and includes a Twig component to render saved content with optional inline styling.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Symfony UX Alignment: Designed as a Symfony UX bundle, leveraging Symfony UX Live Components and Stimulus.js for dynamic form interactions. While the package is Symfony-focused, its core functionality (QuillJS integration) is framework-agnostic and can be adapted for Laravel via Laravel Mix/Webpack or Vite.

  • Laravel Compatibility:

    • Pros:
      • QuillJS is a JavaScript library with no PHP dependencies (beyond form handling), making it easily portable to Laravel.
      • The Twig components can be replaced with Blade directives or JavaScript-based rendering.
      • Asset management (CSS/JS) can be handled via Laravel Mix, Vite, or AssetMapper-like tools (e.g., filp/whoops for debugging).
    • Cons:
      • Symfony-specific abstractions (e.g., QuillType, QuillAdminField, AssetMapper) require rewriting for Laravel.
      • Form handling (e.g., FormBuilderInterface) must be replaced with Laravel’s FormRequest or custom form logic.
      • EasyAdmin integration is Symfony-specific and not directly applicable.
  • Key Features Transferable to Laravel:

    • QuillJS editor integration.
    • Custom toolbars/modules (e.g., tables, mentions, uploads).
    • HTML sanitization (via Laravel’s built-in Str::of() or Purifier).
    • Dynamic content rendering (via Blade or JavaScript).

Integration Feasibility

  • High-Level Workflow:

    1. Install QuillJS: Via npm (npm install quill) or CDN.
    2. Replace Symfony QuillType: With a Laravel Form Request or custom form component (e.g., using collective/html or a Livewire/Alpine.js wrapper).
    3. Replace Twig Components: With Blade directives or JavaScript-based rendering (e.g., using laravel-mix to compile Quill’s CSS/JS).
    4. Handle Uploads: Replace Symfony’s upload_endpoint with a Laravel route (e.g., /api/upload) and Stimulus/Alpine.js for frontend handling.
    5. Sanitization: Use Laravel’s Str::of()->allowedTags() or Purifier.
  • Major Rewrites Required:

    • Form Integration: Laravel lacks a direct FormBuilderInterface equivalent. Options:
      • Use Livewire for reactive forms.
      • Build a custom form component (e.g., with Alpine.js).
      • Integrate with FilamentPHP or Nova if using those admin panels.
    • Asset Pipeline: Laravel’s Mix/Vite can replace AssetMapper or Webpack Encore.
    • Admin Panel Integration: Replace EasyAdmin with Filament, Nova, or a custom backend.

Technical Risk

Risk Area Description Mitigation Strategy
Form Abstraction Gap Laravel’s form handling is less opinionated than Symfony’s. Use Livewire or Alpine.js to mirror Symfony UX’s reactivity.
Asset Loading Quill’s CSS/JS may not load correctly without Symfony’s AssetMapper. Use Laravel Mix/Vite with explicit imports (e.g., quill/dist/quill.snow.css).
Upload Handling Symfony’s upload_endpoint requires backend integration. Create a Laravel route with CSRF protection and Stimulus/Alpine.js for frontend.
Sanitization Symfony’s built-in sanitizer differs from Laravel’s. Use Str::of()->allowedTags() or Purifier for consistency.
Module Customization PHP-based modules (e.g., History) may not translate cleanly. Reimplement as JavaScript modules or use Laravel’s service containers.
Twig → Blade Twig components (e.g., twig:QuillContent) need replacement. Create Blade components or JavaScript-based rendering (e.g., Alpine.js).
EasyAdmin Replacement No direct Laravel equivalent. Use FilamentPHP, Nova, or build a custom admin panel.

Key Questions for Laravel Adoption

  1. Form Handling:

    • Will you use Livewire, Alpine.js, or a custom solution for form reactivity?
    • How will you handle CSRF protection and validation (e.g., Laravel’s FormRequest)?
  2. Asset Management:

    • Will you use Vite, Mix, or CDN links for Quill’s assets?
    • How will you ensure source maps and debugging work (e.g., quill.snow.css.map)?
  3. Uploads:

    • What authentication (CSRF, JWT, Sanctum) will you use for the upload endpoint?
    • How will you handle file storage (S3, local, etc.)?
  4. Sanitization:

    • Will you use Laravel’s Str::of() or a third-party sanitizer (e.g., Purifier)?
    • How will you handle XSS risks in user-generated HTML?
  5. Admin Panel:

    • Will you replace EasyAdmin with Filament, Nova, or a custom backend?
    • How will you integrate Quill into your admin panel’s form builder?
  6. Performance:

    • How will you lazy-load Quill’s heavy modules (e.g., tables, mentions)?
    • Will you use server-side rendering (Blade) or client-side rendering (Alpine.js)?
  7. Maintenance:

    • Who will maintain QuillJS updates (e.g., v2 → v3)?
    • How will you handle breaking changes in Quill’s API?

Integration Approach

Stack Fit

Laravel Component Equivalent in ux-quill Integration Strategy
Blade Twig templates (twig:QuillContent) Replace with Blade components or JavaScript rendering (Alpine.js).
Laravel Mix/Vite AssetMapper/Webpack Encore Use Vite for asset compilation (e.g., quill/dist/quill.snow.css).
Livewire/Alpine.js Symfony UX Live Components Use Alpine.js for dynamic form interactions or Livewire for full reactivity.
Form Requests FormBuilderInterface Replace QuillType with a custom form request or Livewire component.
FilamentPHP/Nova EasyAdmin Integrate Quill via Filament’s form fields or Nova’s custom fields.
Sanitizer Symfony’s built-in sanitizer Use Laravel’s Str::of()->allowedTags() or Purifier.
Stimulus.js Symfony UX Stimulus controllers Use Alpine.js or Stimulus for frontend logic (e.g., uploads, modules).
Storage (S3/Local) Symfony’s upload_endpoint Create a Laravel route with Stimulus/Alpine.js for frontend uploads.

Migration Path

Phase 1: Core Integration (1-2 Weeks)

  1. Install QuillJS:
    npm install quill @popperjs/core
    
    Configure in resources/js/app.js:
    import Quill from 'quill';
    import 'quill/dist/quill.snow.css';
    
  2. Replace Symfony QuillType:
    • Create a Livewire component or Alpine.js form to mirror Quill’s functionality.
    • Example (Alpine.js):
      <div x-data="{ content: @entangle('post.content') }">
          <textarea x-ref="editor" x-model="content"></textarea>
          <script>
              document.addEventListener('alpine:init', () => {
                  Alpine.data('quillEditor', () => ({
                      init() {
                          this.quill = new Quill(this.$refs.editor, {
                              theme: 'snow',
                              modules: { toolbar: '#toolbar' }
                          });
                      }
                  }));
              });
          </script>
      </div>
      
  3. Handle Asset Loading:
    • Use Vite to compile Quill’s CSS
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.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle