- 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.