- Can I use DahoviTech Media Bundle directly in Laravel, or is it strictly for Symfony?
- This bundle is designed for Symfony 7, but you can integrate its API endpoints into Laravel via HTTP clients (Guzzle, Symfony HTTP Client) or use it as a microservice. The bundle’s API-first approach makes it compatible with Laravel projects needing media management without full Symfony adoption.
- What Laravel versions does this bundle support?
- The bundle itself requires Symfony 7, but you can expose its API endpoints to Laravel via REST clients or API Platform’s OpenAPI specs. For direct Laravel integration, consider alternatives like Spatie MediaLibrary or Laravel Nova’s media tools, which are natively Laravel-compatible.
- How do I configure storage for AWS S3 or Google Cloud Storage?
- Use the `OneupFlysystemBundle` integration provided by the bundle. Configure your storage adapter in `config/packages/dahovitech_media.yaml` with your S3/GCS credentials, bucket name, and CORS settings. The bundle handles secure file naming and CDN integration automatically.
- Does this bundle support drag-and-drop uploads in Laravel Blade templates?
- The bundle relies on Symfony UX FilePond for drag-and-drop, which works best with Symfony’s Turbo/Stimulus. For Laravel Blade, you’d need to embed the FilePond JS library manually or use its API endpoints with a custom frontend (e.g., Alpine.js or React). The admin UI is Bootstrap 5-based but can be adapted.
- How does antivirus scanning work, and can I enforce it?
- Antivirus scanning (e.g., ClamAV) is optional and configured via `dahovitech_media.yaml`. Set `scan_antivirus: true` and specify the binary path. For Laravel, you’d need to integrate a PHP antivirus library like `php-clamav` separately or rely on server-level scanning.
- What’s the best way to handle large-scale image transformations in production?
- The bundle uses LiipImagineBundle for transformations, which supports caching and lazy loading. For high traffic, offload processing to a queue (Symfony Messenger or Laravel Queues) and monitor CPU usage. Consider pre-generating thumbnails during uploads for critical paths.
- Are there alternatives to this bundle for Laravel that are lighter or more Laravel-native?
- For Laravel, consider **Spatie MediaLibrary** (simpler, no Symfony dependency) or **Laravel Nova’s media tools** (if using Nova). If you need API-first features, **Filament Media Manager** or **API Platform (via Laravel API Resources)** are alternatives, though they require more setup.
- How do I secure media downloads to private users in Laravel?
- The bundle supports public/private media flags. For Laravel, use middleware to validate API tokens or session auth before serving private media. Example: Route private media through `/api/media/{id}/download` with Laravel’s auth checks or Sanctum/JWT validation.
- What’s the impact of this bundle on my Laravel app’s performance during uploads?
- The bundle’s performance depends on your storage backend and image processing load. For Laravel, test with tools like Blackfire to profile CPU/memory usage during uploads. Optimize by enabling caching, using CDNs, and offloading transformations to workers (e.g., Laravel Horizon).
- Can I customize the admin UI or use my own frontend framework?
- The admin UI is Bootstrap 5-based but can be overridden by extending the bundle’s Twig templates. For Laravel, replace the UI entirely by using the bundle’s API endpoints with your preferred frontend (React, Vue, or Livewire) and styling. The API remains framework-agnostic.