- Can I use c975l/ui-bundle in Laravel instead of Symfony?
- The bundle is Symfony-first, but you can adapt it for Laravel by replacing Doctrine ORM with Eloquent, EasyAdmin with Filament/Backpack, and VichUploader with Spatie Media Library. Drag-and-drop logic via Stimulus/Alpine.js remains reusable. Expect 2–3 weeks of refactoring for full Laravel integration.
- How do I set up drag-and-drop block ordering in Laravel?
- Use Stimulus.js or Alpine.js to handle drag-and-drop interactions. The bundle’s `controllers.js` can be ported to Laravel’s Vite setup. For backend persistence, update Eloquent model positions via `sortablejs` or a custom observer. Filament/Backpack CRUD panels can also integrate this logic with minimal changes.
- What Laravel alternatives exist for dynamic content blocks?
- Consider Filament Blocks, Nova CMS, or Backpack CRUD with custom fields for block systems. For lightweight solutions, use Laravel’s Eloquent + Blade partials with a `position` column. Spatie’s Media Library and Laravelista/vichuploader handle media uploads natively. These options avoid Symfony dependencies entirely.
- Will this bundle work with Laravel 10+ and PHP 8.2?
- The bundle requires PHP 8.0+ and Symfony components, but Laravel compatibility depends on your refactoring. Replace Doctrine with Eloquent (or DBAL) and test migrations. PHP 8.2’s strict typing may require adjustments to Symfony’s metadata handling. Always test in a staging environment before production.
- How do I migrate from Symfony’s EasyAdmin to Laravel’s Filament?
- Replace EasyAdmin CRUD with Filament’s `Resource` classes. Port block management logic to Filament’s custom fields or panels. Drag-and-drop can be added via Stimulus controllers attached to Filament’s table or form components. Use Filament’s `TableActions` or `FormActions` to replicate EasyAdmin’s AJAX kind-switcher.
- Does this bundle support media uploads in Laravel?
- Yes, but you’ll need to replace VichUploader with Laravel-compatible alternatives like Spatie Media Library or Laravelista/vichuploader. These libraries integrate with Eloquent models and support collections, thumbnails, and conversions. The bundle’s media handling logic (e.g., `BlockOrphanListener`) can be adapted to these libraries.
- How do I extend the bundle to add custom block types?
- In Symfony, you register block kinds via service tags. In Laravel, create a service provider to register block types using tags or a facade. Implement a base `Block` model with polymorphic relations for owners. Use traits or interfaces to standardize block behavior (e.g., `HasBlocksTrait` adapted for Eloquent).
- Can I use this bundle with Livewire or Inertia.js?
- Yes, but frontend integration requires adjustments. Stimulus controllers can coexist with Livewire/Inertia by mounting them on specific DOM elements. For drag-and-drop, use Alpine.js or a Livewire component to manage block positions. Backend logic (e.g., block creation/deletion) should use Livewire’s actions or Inertia’s API calls.
- What’s the performance impact of using Doctrine ORM in Laravel?
- Doctrine ORM is heavier than Eloquent and may slow down queries for dynamic blocks. Replace it with Eloquent or DBAL for better performance. Benchmark CRUD operations (e.g., block creation, reordering) in both setups. For large-scale apps, consider caching block layouts or using Laravel’s query caching.
- How do I handle CSS/JS injection in Laravel’s Blade templates?
- Replace the bundle’s `bundle_stylesheets()` Twig function with Blade’s `@stack` directives or a custom view composer. Register assets via Laravel Mix/Vite. For dynamic block styles, use inline Blade logic or a service provider to push stylesheets to the layout. Example: `@stack('block-styles')` in your master layout.