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

fresh/vich-uploader-serialization-bundle

Symfony bundle that integrates VichUploaderBundle with the Symfony Serializer, exposing uploaded file URLs and metadata in JSON API responses. It removes the need for custom normalizers when serializing entities with file fields. Lightweight and easy to configure for API Platform and Symfony APIs.

View on GitHub
Deep Wiki
Context7

A Symfony bundle that adds serialization support for VichUploaderBundle entities, making uploaded-file fields work smoothly with the Symfony Serializer. It helps expose file metadata and restore upload references during serialization/deserialization without custom glue code.

  • Integrates VichUploaderBundle with Symfony Serializer
  • Supports serializing uploaded-file fields and related metadata
  • Handles denormalization for file references during deserialization
  • Configurable, lightweight, and easy to register in Symfony apps
  • Reduces boilerplate when building APIs around file-backed entities
Frequently asked questions about Vich Uploader Serialization Bundle
What does fresh/vich-uploader-serialization-bundle do?
It is a Symfony bundle that integrates VichUploaderBundle with JMSSerializerBundle. It makes Vich-managed file properties serialize as usable URLs or metadata instead of raw file objects. It is not a Laravel package.
Can I use fresh/vich-uploader-serialization-bundle in Laravel?
No, it is a Symfony bundle and has no Eloquent, bundle registration, or JMS config seam in a Laravel app. Implement the same behavior with an Eloquent accessor, API Resource, or JsonResource returning Storage::url($this->path). If you already use jms/serializer on the PHP side, write a small handler instead.
How do I install fresh/vich-uploader-serialization-bundle?
In a Symfony app, install it with Composer and register the bundle in config/bundles.php. You also need VichUploaderBundle and JMSSerializerBundle configured. Because the repository is archived, prefer forking or vendoring it rather than relying on a live Packagist dependency.
Does this package work with Symfony 6.4 or Symfony 7?
The last release was 2022-08-15 and the project is archived, so modern PHP 8.2+ and Symfony 6.4/7.x projects will likely hit Composer constraint conflicts. There is no upstream path to widen constraints or fix compatibility. Check resolution in a throwaway branch before planning any adoption.
Is fresh/vich-uploader-serialization-bundle maintained?
No, the repository is explicitly archived. That means no bug fixes, security patches, or compatibility work for new PHP or Symfony majors. Most production dependency policies treat archived packages as a hard gate.
What are alternatives to this bundle for serializing uploaded file URLs?
In Laravel, use an Eloquent accessor, an API Resource, or a JsonResource that returns Storage::url or a CDN URL. In Symfony with JMS already present, write a small custom handler or normalizer around Vich's URI generator. If you need the bundle's exact behavior, fork and own the small code surface.
What are the production risks of using an archived serialization bundle?
The blast radius is small because Vich still moves files and JMS still owns the serialization graph; this bundle only formats output. The risk is dependency rot: no security patches, no PHP/Symfony compatibility updates, and zero downstream dependents for validation. Treat it as a fork-and-own candidate, not a live dependency.
How should I test file URL serialization with VichUploaderBundle and JMSSerializerBundle?
Test the serialized payload, not the bundle internals: assert that file fields become URLs or expected metadata and never leak storage paths. Cover absolute URL generation, CDN domains, and proxy headers if those are part of your API contract. Also test Composer resolution on your minimum PHP and Symfony versions.
Does this bundle work without JMSSerializerBundle or VichUploaderBundle?
No, it is a glue layer between those two Symfony libraries. VichUploaderBundle handles file movement and URI generation, and JMSSerializerBundle handles the serialization graph. Adopting it without both pulls in dependencies just to format one field.
Should I fork fresh/vich-uploader-serialization-bundle or rewrite the logic?
The code surface is small, so rewriting the intent is often cheaper than owning a fork. In Laravel, rewrite as an accessor or JsonResource; in Symfony, rewrite as a JMS handler or normalizer if you already use JMS. Fork only if you need byte-for-byte output compatibility and can maintain PHP/Symfony constraints yourself.
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