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.
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:
filp/whoops for debugging).QuillType, QuillAdminField, AssetMapper) require rewriting for Laravel.FormBuilderInterface) must be replaced with Laravel’s FormRequest or custom form logic.Key Features Transferable to Laravel:
Str::of() or Purifier).High-Level Workflow:
npm install quill) or CDN.QuillType: With a Laravel Form Request or custom form component (e.g., using collective/html or a Livewire/Alpine.js wrapper).laravel-mix to compile Quill’s CSS/JS).upload_endpoint with a Laravel route (e.g., /api/upload) and Stimulus/Alpine.js for frontend handling.Str::of()->allowedTags() or Purifier.Major Rewrites Required:
FormBuilderInterface equivalent. Options:
| 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. |
Form Handling:
FormRequest)?Asset Management:
quill.snow.css.map)?Uploads:
Sanitization:
Str::of() or a third-party sanitizer (e.g., Purifier)?Admin Panel:
Performance:
Maintenance:
| 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. |
npm install quill @popperjs/core
Configure in resources/js/app.js:
import Quill from 'quill';
import 'quill/dist/quill.snow.css';
QuillType:
<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>
How can I help you explore Laravel packages today?