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
Data Uri Bundle

Data Uri Bundle Laravel Package

1tomany/data-uri-bundle

Symfony bundle wrapping 1tomany/data-uri: auto-configures a denormalizer for TemporaryFileInterface objects and adds a console command to encode files as base64 data URIs. No configuration needed.

View on GitHub
Deep Wiki
Context7

Data URI Bundle integrates the 1tomany/data-uri library into Symfony, letting you convert base64 data URIs into temporary file objects directly from request payloads. The bundle registers a serializer normalizer for any class implementing OneToMany\DataUri\Contract\Record\TemporaryFileInterface, so denormalization works out of the box with zero configuration.

  • Auto-tagged TemporaryFileNormalizer for TemporaryFileInterface objects
  • onetomany:data-uri:encode-file command to generate base64 data URIs from files
  • No configuration required — install and use immediately
  • Seamless integration with Symfony's Serializer component
Frequently asked questions about Data Uri Bundle
Is 1tomany/data-uri-bundle compatible with Laravel?
No. It is a Symfony bundle, and Laravel has no bundle class, compiler pass, or DI tag system for serializer normalizers. The auto-tagged TemporaryFileNormalizer will not be registered in a Laravel application. To get the same behavior you would need to write your own service provider binding, cast, or validation rule.
How do I install 1tomany/data-uri-bundle?
Install it with Composer using composer require 1tomany/data-uri-bundle. It is intended for Symfony applications that use the Serializer component. In Laravel the package will install, but the bundle wiring will not execute, so you get no working normalizer or command.
What components does 1tomany/data-uri-bundle provide?
It provides two components: a TemporaryFileNormalizer for classes implementing TemporaryFileInterface and the onetomany:data-uri:encode-file console command. The normalizer handles denormalization from base64 data URIs into temporary file objects. The command generates a base64 data URI from a file.
Does 1tomany/data-uri-bundle require configuration?
In Symfony, no configuration is required because the normalizer is automatically tagged and configured. That zero-config claim applies only to Symfony's container and serializer wiring. The README does not document failure behavior, maximum file size, or memory characteristics.
What Laravel version does 1tomany/data-uri-bundle support?
None. The package targets Symfony, not Laravel, so Laravel version support is not applicable. There is no Laravel service provider, facade, cast, or Artisan command. You would have to build that integration yourself.
Is 1tomany/data-uri-bundle maintained?
No. The repository is archived, with zero stars and zero dependents, and it has a pre-1.0 0.x release history. Archival means no security patches, no PHP 8.4 or 8.5 fixes, and no Symfony 8 support. It is not a safe production dependency.
How do I convert a base64 data URI to a file in Laravel?
You can decode the base64 payload with base64_decode and write it with Laravel's filesystem or file_put_contents. Add validation for MIME type and a hard size ceiling before writing. A custom cast or validation rule is a small amount of glue and avoids depending on an archived Symfony bundle.
What are alternatives to 1tomany/data-uri-bundle for Laravel?
For Laravel, implement the conversion directly with base64_encode, finfo or mime_content_type, and size guards, or use Laravel's file upload and validation features. You can also consume the framework-agnostic 1tomany/data-uri library directly, but the bundle itself adds no Laravel value. The wrapper is only about two files.
Does 1tomany/data-uri-bundle have tests or documentation?
The README documents only the normalizer and the console command. It does not reference a test suite, state a maximum file size, or define an error contract for unreadable files. That makes error handling and production behavior hard to scope.
Are data URIs safe to accept in API payloads?
Data URIs carry inherent risk: base64 inflates payloads by about 33 percent, they are opaque to browser caching, and data:text/html or data:image/svg+xml can carry executable content. Any adoption needs your own MIME allowlist and a hard size ceiling. These controls are required regardless of which package you use.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
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