Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Uploader Bundle

Uploader Bundle Laravel Package

vich/uploader-bundle

VichUploaderBundle is a Symfony bundle that simplifies file uploads attached to ORM entities, MongoDB ODM documents, or PHPCR ODM documents. It automatically names and saves files, injects them back as File objects, deletes them on removal, and provides templating helpers for public URLs.

View on GitHub
Deep Wiki
Context7

Ease file uploads attached to entities

Frequently asked questions about Uploader Bundle
Is vich/uploader-bundle compatible with Laravel?
No. VichUploaderBundle is a Symfony bundle with no Laravel service provider, no Laravel-style config publishing, and no Eloquent integration. It depends on Symfony's bundle, configuration, and dependency-injection machinery, Doctrine lifecycle events, and Twig. For Laravel applications, a Laravel-native media library is the realistic choice.
Can I use VichUploaderBundle with Eloquent models?
Not realistically as-is. The bundle's core behavior is coupled to Doctrine ORM and ODM lifecycle events, and Eloquent is not supported. Making it fit would mean running Doctrine and Symfony components inside Laravel, which is a substantial architectural commitment for a feature Laravel already serves well through Flysystem and packages like spatie/laravel-medialibrary.
How do I install vich/uploader-bundle?
Install it with composer require vich/uploader-bundle, register the bundle in your Symfony application, define mappings in config/packages/vich_uploader.yaml, annotate or attribute the entity or document, and add the form type. In a Symfony and Doctrine stack this is high feasibility, typically days rather than weeks for a first entity. It is not a drop-in Composer package for a Laravel codebase.
Which Symfony and PHP versions does vich/uploader-bundle support?
Check the package's composer.json and UPGRADE.md for the exact Symfony and PHP constraints, because the project is mid-transition. The 2.x line is winding down, with v2.10.0 explicitly flagged as the last minor in branch 2, and 3.0 is at release candidate. The 2.0 line removed deprecated APIs, made classes final, added full type hints, and defaulted mapping to attributes over annotations.
What Laravel alternatives should I use instead of VichUploaderBundle?
Laravel has native Flysystem integration and packages such as spatie/laravel-medialibrary that handle uploads, storage, URL generation, and attaching files to models. These follow Laravel conventions and avoid pulling Symfony and Doctrine into the application. Pick one that matches your storage, media conversion, and model-attachment requirements.
Does VichUploaderBundle support MongoDB ODM and PHPCR ODM?
Yes, in addition to Doctrine ORM entities, the bundle supports MongoDB ODM documents and PHPCR ODM documents. The MongoDB ODM and PHPCR paths carry more bug history and narrower test coverage than ORM, and MongoDB changeset handling has been fixed multiple times. If you only need ORM, prefer that path for lower risk.
How does VichUploaderBundle delete files when an entity is removed?
It binds deletion to Doctrine entity or document removal, deleting the file from the configured filesystem or storage. That is convenient, but file writes and database commits are separate concerns. A rolled-back transaction or a failed file write can leave orphaned files or dangling references, so plan cleanup and reconciliation for production.
Is vich/uploader-bundle production-ready?
It is mature, with roughly 1.9k GitHub stars and a multi-year release history from 1.21 through 2.10 to 3.0 RC, but a major-version transition is in flight. The 2.9.3 tag was marked DO NOT USE for broken backward compatibility, with follow-up realignment releases and repeated reverts. Pin versions and stage upgrades carefully rather than floating to latest.
Why was VichUploaderBundle 2.9.3 marked DO NOT USE?
The 2.9.3 tag was published and then flagged for broken backward compatibility. Follow-up releases, including 2.9.4 and 2.10.0, realigned things, and there have been repeated reverts and backward-compatibility restoration PRs across the 2.9.x, 2.10, and 3.x RC lines. Avoid 2.9.3 and use a pinned, verified version instead.
Can I use VichUploaderBundle in a standalone PHP app without Symfony?
It is a Symfony bundle, so practical use assumes Symfony's bundle, configuration, and dependency-injection machinery plus Doctrine lifecycle events. With non-Doctrine persistence such as raw PDO or custom repositories, the bundle's value drops sharply because its core behaviors are coupled to ORM and ODM events. For standalone apps, a simpler upload component is usually a better fit.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager