prolix/image-bundle
Prolix ImageBundle adds image handling to PHP applications: define filters and thumbnail sizes, generate resized or cropped images on demand, and cache results for fast delivery. Configurable and easy to wire into existing templates and controllers.
VichUploaderBundle is a Symfony/Doctrine bundle, not a Laravel package — there is no service provider, no config/vich_uploader.php to publish, and no facade. If you are in a Laravel codebase, the first thing to confirm is whether you actually need it (you almost certainly want spatie/laravel-medialibrary or a small custom upload service instead). If you are in a Symfony app, or a mixed repo, proceed:
composer require vich/uploader-bundle:^3.0 — 3.0.0 is the first line that targets Symfony 5.1+, so this is a hard floor, not a suggestion. Verify the transitive constraints before bumping.config/bundles.php (Symfony) and create config/packages/vich_uploader.yaml with db_driver: orm and at least one named mapping (upload_destination, uri_prefix, namer, directory_namer).#[Vich\Uploadable], add the Vich\UploadableTrait, one #[Vich\UploadableField(mapping: '...', fileNameProperty: 'imageName')] property holding the File/UploadedFile, and a string property for the stored filename.setImageFile($uploadedFile), set updatedAt, then flush(). The bundle's Doctrine listeners handle upload-on-persist, expose-on-load, and delete-on-remove.VichImageType / VichFileType in your form class; they render the current file link plus the upload input and wire the *File property without manual plumbing.persist() + flush(). Keep this in a dedicated service if you need post-upload processing (thumbnails, virus scan, DB transaction wrapping).avatars and documents) is the standard way to get different destinations, namers, and URI prefixes; don't overload one mapping with conditionals.property namer keeps the client filename (friendly URLs, collision risk), hash namer is the safe default for user content. Pair with directory_namer (date or entity-id subdirectories) to avoid single-directory blowups on object storage.null (or call removeFile) and flush — the delete_on_update option removes the old file. No manual unlink() in most cases.vich_uploader.storage service to an S3/GCS adapter so the same entity code works across environments; keep uri_prefix environment-specific (CDN in prod, local path in dev).StreamedResponse from the storage service or an asset URL. Never expose the raw binary property on a JSON resource — serialize only the filename/URL.config/packages/test/vich_uploader.yaml, point upload_destination at a temp dir and set storage: vich_uploader.storage.file_system; assert on the filename property rather than filesystem bytes.updatedAt must actually change. The update listener only fires when Doctrine detects a dirty entity. If a user replaces a file, call setUpdatedAt(new \DateTime()) yourself or the new upload is silently skipped. This is the number-one bug report for the bundle.inject_on_load injects a file object on postLoad; it breaks serialization and some form re-renders. Enable it only where you need it, and exclude the *File property from your serializer groups.try/catch with cleanup, or run a periodic sweeper.vich/uploader-bundle ^2.x. If you're on Symfony 4.4, stay on 2.x — 3.0.0 will not resolve.Vich\UploaderBundle\Mapping\Annotation imports before upgrading.bin/console debug:container vich_uploader to confirm the configured mappings and storage service, and bin/console debug:event-dispatcher to verify the listeners are registered — a missing vich_uploader.yaml section fails silently as "no upload happened."Vich\UploaderBundle\Naming\NamerInterface), directory namers, and custom storage adapters are the supported seams. Prefer a namer over a Doctrine event subscriber that post-processes filenames — subscribers run outside the bundle's ordering guarantees.How can I help you explore Laravel packages today?