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
Vich Uploader Serialization Bundle

Vich Uploader Serialization Bundle Laravel Package

rithlock/vich-uploader-serialization-bundle

Bridges VichUploaderBundle and Symfony Serializer so uploadable entities can be serialized cleanly in APIs. Adds normalizers and helpers for exposing file URIs, metadata, and upload fields without custom boilerplate, simplifying JSON responses for REST and JSON:API projects.

View on GitHub
Deep Wiki
Context7

📦 Provides integration between VichUploaderBundle and JMSSerializerBundle.

Frequently asked questions about Vich Uploader Serialization Bundle
Is rithlock/vich-uploader-serialization-bundle a Laravel package?
No. It is a Symfony bundle, identified by its Bundle suffix, DependencyInjection conventions, and dependencies on vich/uploader-bundle and jms/serializer-bundle. There is no service provider, facade, Eloquent integration, or Storage facade wiring, so it has no architecture fit for a Laravel codebase. The correct Laravel equivalent is a first-party Eloquent accessor or JsonResource that derives the URL from the Storage facade.
How do I install and register the bundle in a Symfony application?
Install it with composer require rithlock/vich-uploader-serialization-bundle, then register the bundle in config/bundles.php. You must already have VichUploaderBundle with at least one configured mapping and JMSSerializerBundle installed at compatible versions. When those preconditions hold, integration is a composer require, a bundle registration line, and an annotation on the filename property, which is well under a day of engineering.
What are the prerequisites for using this bundle?
You need Symfony FrameworkBundle, Doctrine ORM, VichUploaderBundle with a working mapping such as uri_prefix, upload_destination, and namer, and JMSSerializerBundle at a compatible version. There is no partial adoption: you cannot use it to serialize Laravel UploadedFile results, and you cannot use it without JMS Serializer as the serialization engine despite the description's loose wording. If those preconditions do not hold, feasibility collapses.
Does it work with Symfony Serializer instead of JMS Serializer?
The overview mentions the Symfony Serializer, but the declared dependency is jms/serializer-bundle, and the technical assessment treats JMS Serializer as required. Treat the description as imprecise and verify the actual normalizer and handler wiring in the source before adopting. Symfony Serializer alone appears to be insufficient for this bundle.
How do I configure the URI prefix for CDN or asset base paths?
The URI prefix comes from your VichUploader mapping configuration, not from a separate bundle-level setting. Because the bundle re-derives paths that Vich already generates, any change to the namer or uri_prefix configuration can silently emit broken links into a client-facing API contract. Test URL output after any mapping change and compare it against your existing API responses.
Which Symfony and PHP versions does this bundle support?
The declared version constraints are unverified because there is no adoption signal, no dependents, and no community-submitted compatibility patches. Check the composer.json constraints and confirm the dependency graph resolves against your pinned PHP and Symfony versions today. An unmaintained bundle will eventually fail Composer resolution on a Symfony major upgrade, so plan for that.
What exactly does the serializer emit: absolute URL, relative URI, filename, size, or mime type?
The bundle supplies a serializer handler that converts a Vich-managed filename property into a resolvable URL at serialization time. Whether that is an absolute URL or a relative URI, and whether it includes original filename, size, or mime metadata, must be verified in the source and in tests. Compare the output byte-for-byte against your existing API contract before relying on it.
Is this bundle maintained and safe to use in production?
There is effectively zero adoption evidence: no stars, no dependents, no downstream projects, and no production usage signal. There has been no security review of the path and URL construction that feeds public API responses, and commit recency and release history are unknown. Treat every declared constraint as unverified and consider vendoring or forking the code if you adopt it.
What happens when the file property is empty or the file is missing?
Empty or missing-file handling is one of the cases you must explicitly verify in the bundle's tests before adopting it. Because this is glue code, a break surfaces as malformed JSON with null or stale file URLs rather than a clean exception. That kind of failure is silent, contract-visible, and often caught by a customer rather than a test.
What are the alternatives to using this bundle?
The main alternative is writing a small custom JMS serializer handler or Symfony normalizer yourself; if the handler is roughly 100 to 200 lines of glue, that reframes the build-versus-buy decision. The bundle's source is useful as a pattern reference even if you do not install it. For Laravel projects, use an Eloquent accessor or JsonResource that derives the URL from the Storage facade instead.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections