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
Doctrine Type Bundle

Doctrine Type Bundle Laravel Package

shopery/doctrine-type-bundle

A Symfony bundle that adds custom Doctrine DBAL types, making it easy to map value objects and domain-specific types directly to database columns. It handles type registration and conversion so persistence stays clean and consistent across your application.

View on GitHub
Deep Wiki
Context7

Automatic "discovery" of Doctrine types in Symfony projects

Frequently asked questions about Doctrine Type Bundle
What is shopery/doctrine-type-bundle used for?
It is a Symfony bundle that registers custom Doctrine DBAL types so entities can map value objects or domain-specific values to database columns without repeating conversion logic. It keeps type registration and conversion centralized and reusable. It is lightweight and designed for standard Symfony and Doctrine setups.
How do I install shopery/doctrine-type-bundle with Composer?
Run composer require shopery/doctrine-type-bundle. Then enable the bundle in your Symfony application, typically in config/bundles.php. The bundle's DI extension registers the provided Doctrine types automatically. Check the repository README for exact version constraints.
Does this package work with Laravel?
No, it is a Symfony bundle, not a Laravel package, so it does not use Laravel package auto-discovery. Laravel applications can still use custom Doctrine DBAL types if they use Doctrine, but they would need to register the type classes manually or through a service provider. There is no Laravel-specific configuration or version support in this bundle.
How are the custom Doctrine types registered in Symfony?
The bundle's DI extension auto-registers the provided types with Symfony's Doctrine configuration. In most setups, enabling the bundle is enough. If you need to override or add types, you can configure them under doctrine.dbal.types in your Symfony configuration.
Which custom Doctrine DBAL types does it provide?
The bundle ships a set of ready-to-use custom Doctrine types, but the exact list should be taken from the repository README or source. It does not aim to provide every possible type; it centralizes reusable conversion logic. Review the available types before mapping entity fields.
Do I need to configure doctrine.dbal.types manually?
Usually no, because the bundle registers its types through its DI extension. Manual configuration is only needed if you disable auto-registration, override a type name, or use the type classes outside the bundle's Symfony integration. For Laravel or non-Symfony setups, manual registration is expected.
Is shopery/doctrine-type-bundle compatible with my Symfony and Doctrine versions?
Compatibility depends on the package's Composer constraints for symfony/* and doctrine/dbal, so check those before upgrading. It targets standard Symfony and Doctrine setups and has no extra runtime dependencies. Run composer why-not or review the package requirements if you hit conflicts.
How should I test entities that use these Doctrine types?
Unit-test the type conversion by calling convertToDatabaseValue and convertToPHPValue directly. For integration tests, boot a Symfony kernel with Doctrine configured and use an in-memory SQLite database to verify schema mapping and persistence. Ensure the type is registered in the test environment's Doctrine configuration.
What are the production concerns when using this bundle?
Keep the registered type names stable, because Doctrine uses them in mapping metadata and migrations. Test schema changes and data conversions in staging before deploying. The bundle is lightweight with no extra runtime dependencies, but you should still review its release history and Composer constraints.
What are alternatives to using this bundle?
You can write custom Doctrine DBAL Type classes yourself and register them in doctrine.dbal.types. Doctrine embeddables or value-object mapping libraries may also fit, depending on your domain model. This bundle mainly saves duplication by packaging reusable types and Symfony auto-registration.
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