-
-
Notifications
You must be signed in to change notification settings - Fork 471
Open
Labels
Description
Hi,
I'd like to propose a feature for DoctrineBundle that would allow configuring DBAL middlewares per connection directly in the doctrine.yaml configuration file.
This would enable central and consistent management of all connection-related settings in one place — especially useful in applications with multiple DBAL connections.
Currently, middlewares can be configured globally or via attributes/service tags. While this works, supporting configuration at the YAML level per connection would provide a more flexible and declarative approach.
Example:
doctrine:
dbal:
default_connection: default
connections:
default:
driver: pdo_pgsql
url: "%env(DATABASE_URL)%"
middlewares:
- App\Doctrine\CustomMiddleware1
custom:
driver: pdo_pgsql
url: "%env(DATABASE_CUSTOM_URL)%"
middlewares:
- App\Doctrine\CustomMiddleware2
Thanks for your great work on the bundle!
Best regards,
Daniel