- Can I use gam6itko/doctrine-multibase-bundle in a Laravel application?
- No. This is a Symfony bundle, and its value comes from Symfony's dependency-injection container, bundle extension, and compiler passes, none of which exist in Laravel. It also targets Doctrine ORM rather than Eloquent. There is no supported installation path in a Laravel codebase, so treat it only as a reference implementation of runtime connection switching.
- Does doctrine-multibase-bundle work with Laravel Eloquent?
- No. The bundle is built for Doctrine ORM and its EntityManager, not Laravel's Eloquent ORM. Eloquent models, query builder connections, and Laravel's database manager are outside its scope. If your Laravel app uses Eloquent, this package is not conceptually adjacent to your data layer.
- How do I switch database connections per tenant in Laravel without this bundle?
- Use Laravel's native multi-connection support and call DB::connection('tenant_a') on the query builder, or use a tenancy package such as stancl/tenancy or spatie/laravel-multitenancy. Both handle connection swapping without pulling in Symfony machinery. If you need Doctrine, wrap a scoped EntityManager per tenant in your own service provider.
- What are the best Laravel alternatives to doctrine-multibase-bundle for multi-database support?
- The main options are Laravel's built-in multiple connections in config/database.php, stancl/tenancy for per-tenant databases, spatie/laravel-multitenancy, and laravel-doctrine with a custom connection resolver. All of these are designed for Laravel's container and lifecycle. Choose based on whether you are on Eloquent or Doctrine and whether isolation must be physical.
- Is doctrine-multibase-bundle compatible with DBAL 4.x and PHP 8.2+?
- Compatibility is unverified. A bundle of this vintage and adoption level is unlikely to track DBAL's connection and DriverManager API churn. Assume breakage on upgrade and budget for a fork if you adopt any code. Test against your exact Doctrine ORM, DBAL, and PHP versions before relying on it.
- Is doctrine-multibase-bundle actively maintained and safe for production?
- It has zero stars and zero dependents and is effectively a single-maintainer project, so there is no community signal that its edge cases have been exercised in production. If you fork it, you own it permanently, including security patches and DBAL compatibility fixes. Treat it as a design input rather than a dependency.
- How does doctrine-multibase-bundle handle transactions when switching connections?
- There is no evidence of read/write split awareness or connection-pool semantics in the bundle. Swapping the base connection mid-request risks entities hydrated from one database being flushed to another and transactions being misattributed. It is also unclear whether a switch mid-transaction fails loudly or silently, so you must test that boundary explicitly.
- Can I use doctrine-multibase-bundle with laravel-doctrine?
- Conceptually the capability is adjacent because both involve Doctrine under Laravel, but the bundle's Symfony DI wiring will not load in Laravel's container. You would reimplement the switching mechanism in a Laravel service provider that hands out a scoped EntityManager per tenant. The repository is useful for sanity-checking the approach, not for installation.
- What are the risks of runtime Doctrine connection switching in Laravel?
- Doctrine's EntityManager caches metadata, the unit-of-work identity map, and depending on config second-level cache and prepared statements per connection. Swapping the base connection mid-request risks stale identity maps, cross-database flushes, and misattributed transactions. Run a load test and verify isolation before trusting any implementation in production.
- How should I test multi-database connection switching in a Laravel app?
- Test identity map isolation, metadata cache behavior, and transaction boundaries per connection, including what happens when a switch occurs mid-transaction. Add integration tests that hydrate from one database and flush to another to confirm failures are loud rather than silent. Finish with a load test that exercises concurrent tenant switching before relying on the pattern.