- Is cesurapp/media-bundle compatible with Laravel?
- No, cesurapp/media-bundle is a Symfony bundle built around Doctrine ORM, Symfony events, and dependency injection, not a Laravel-native package. It requires PHP 8.4+ and Symfony 8.0+, and using it in Laravel would require significant refactoring of entities, events, storage, and reference counting. For Laravel applications, evaluate spatie/laravel-medialibrary or a custom solution first.
- How do I install cesurapp/media-bundle?
- Install it with composer require cesurapp/media-bundle in a Symfony project that meets the PHP 8.4+ and Symfony 8.0+ requirements. Follow the README to add MediaInterface and MediaTrait to Doctrine entities, configure storage through cesurapp/storage-bundle, and use MediaManager for uploads. This is a Symfony installation path, not a Laravel package installation.
- What Laravel version does cesurapp/media-bundle support?
- It does not document or test support for any Laravel version because it is a Symfony bundle. The package targets Symfony 8.0+ and relies on Symfony and Doctrine conventions. Adding Laravel support would require a port rather than a simple Composer install.
- How does reference counting work in cesurapp/media-bundle?
- The bundle automatically tracks media files and uses reference counting to decide when files are unused and can be cleaned up. Cleanup and reference behavior rely on Symfony's event system and Doctrine entity workflows. In Laravel, you would need to reproduce this with model observers, queued jobs, or custom database logic.
- Can I use cesurapp/media-bundle with Eloquent models?
- Not directly, because the package expects Doctrine entities implementing MediaInterface and using MediaTrait. A Laravel port would need Eloquent accessors, mutators, custom traits, and manual reference-counting logic. The assessment rates this as high-effort integration work.
- What upload methods does cesurapp/media-bundle support?
- MediaManager supports HTTP file uploads, Base64 uploads with MIME validation, remote URL downloads, and direct content creation. It can also compress images, convert formats such as PNG or JPEG to JPG, set JPEG quality, and resize while preserving aspect ratio. Multiple media columns per entity are supported through MediaTrait variants.
- Does cesurapp/media-bundle support S3 or multi-cloud storage?
- The bundle builds on cesurapp/storage-bundle, which provides storage abstraction and can reduce vendor lock-in across backends. The exact S3, GCS, or multi-cloud support depends on the storage bundle configuration and adapters. In Laravel, you would need to adapt this layer to the Storage facade or custom filesystem drivers.
- Is cesurapp/media-bundle maintained and production-ready?
- The technical assessment flags limited community support, no visible activity, and 0 stars, which raises maintenance concerns. It also notes no Laravel-specific documentation or test suite and no backward compatibility guarantees. Treat it as an abandonware risk and validate the repository activity before using it in production.
- What are alternatives to cesurapp/media-bundle for Laravel?
- For Laravel, spatie/laravel-medialibrary is a mature Eloquent-native option with active maintenance, while intervention/image is a lightweight image-manipulation package without ORM coupling. A hybrid approach using spatie/laravel-medialibrary plus custom traits for reference counting may be viable. Compare these with building a custom media layer if your storage or cleanup requirements are unusual.
- How much effort is porting cesurapp/media-bundle to Laravel?
- Porting is high effort: you would replace MediaTrait with Eloquent accessors, mutators, or custom traits; replace Symfony events with Laravel observers or model events; adapt storage to Laravel's filesystem abstractions; and implement manual reference counting. Laravel lacks Doctrine's cascade-delete behavior, so cleanup and race-condition handling would need careful design, likely with queued jobs. Compare the ROI of porting against adopting a Laravel-native package or building a focused custom solution.