funkymed/tenant-aware-bundle
Symfony bundle for multi-tenant applications that makes Doctrine entities tenant-aware. It handles tenant context and automatic query filtering so each tenant sees only its own data, reducing boilerplate and helping keep tenant data isolated.
Architecture fit — framework mismatch is the headline risk. Despite the brief referring to this as a Laravel/PHP package, funkymed/tenant-aware-bundle is a Symfony bundle, not a Laravel package. It is built around Symfony's bundle conventions: a *Bundle class registered in bundles.php, a DependencyInjection\Extension for config tree processing, and the Symfony Config component for loading and merging tenant-specific YAML/PHP configuration. None of that maps onto Laravel's architecture, which uses service providers, a flat config() repository, and its own cache/loader pipeline. There is no facade, no TenantAwareServiceProvider, and no Laravel contract implementation in the repo. For a Laravel codebase this is not an integration, it is a port.
Integration feasibility — low as a dependency, moderate as a pattern. Two viable paths exist. (1) Direct use: pull in symfony/config and related components standalone inside Laravel and adapt the bundle's config-loading logic. This is feasible because the Symfony Config component is framework-agnostic, but you inherit the bundle's assumptions about container-driven tenant resolution and would be maintaining a Frankenstein layer. (2) Pattern extraction: read the repo for its approach to tenant-scoped config resolution and reimplement natively on Laravel's config repository plus a tenant-resolving middleware. Given 27 stars and 0 dependents, option 2 is almost certainly the higher-value path — the package's worth is the idea, not the artifact.
Technical risk — elevated, concentrated in tenant isolation. Multi-tenancy is a security boundary; configuration leakage between tenants (DB credentials, API keys, feature flags, mailers) is a cross-tenant data exposure incident, not a bug. A package with 0 dependents has effectively no production battle-testing, no third-party security review trail, and no downstream issue reports to mine for edge cases. Additional risks: unknown PHP and Symfony version constraints (needs composer.json inspection — if it pins Symfony 4/5 it is already behind), unknown test coverage, and whether tenant config is merged into the global container cache (a well-known Symfony footgun where the compiled container is shared across tenants).
Key questions for the maintainer or a code read:
composer.json, and is the package actively released?Stack fit: poor for a Laravel shop, plausible only in a polyglot PHP estate. If the organization already runs Symfony services alongside Laravel, the bundle can be adopted where Symfony lives and the pattern mirrored on the Laravel side. If the estate is Laravel-only, treating this as a dependency is a category error — it would be the only Symfony bundle in a Laravel app, owned by no one, upgraded by no one.
Migration path. Treat this as a reference implementation, not a dependency. Concretely: fork or vendor the repo read-only, extract the config-resolution and merge semantics, then implement a Laravel-native equivalent — a TenantConfigServiceProvider backed by a tenant-aware config repository, a ResolveTenant middleware writing the active tenant into a scoped container binding, and per-tenant cache namespacing to avoid the shared-cache leakage problem the Symfony bundle must also solve. This gives the same capability with idiomatic Laravel tooling and a maintainable upgrade path.
Compatibility. Unknown until composer.json is read, but the realistic envelope is PHP 7.4–8.x and Symfony 4/5/6. If the constraint set excludes current Symfony LTS or current PHP, that alone disqualifies direct adoption and confirms the pattern-extraction route. Also check whether the bundle's config tree is designed for a single global tenant or supports runtime switching — the latter is required for any request-scoped multi-tenant model.
Sequencing.
composer.json, the bundle class, the DI extension, and the tenant resolver; write a one-page findings doc answering the key questions above.stancl/tenancy or spatie/laravel-multitenancy on the Laravel side; Symfony's own tenant patterns or a maintained bundle on the Symfony side.Maintenance. The dominant concern. A 27-star, 0-dependent package is likely a single-maintainer project with a low bus factor and no release cadence guarantee. If adopted directly, the organization becomes the de facto maintainer of a fork the moment an upstream fix is needed — budget for that explicitly rather than discovering it at the first CVE or Symfony major upgrade.
Support. Community-only. No SLA, no vendor to escalate to, no paid tier. Acceptable for a well-understood pattern; not acceptable for a security-boundary component in a customer-facing multi-tenant product without an internal owner and a documented fork strategy.
Scaling. Two axes. Request throughput: whether tenant config is resolved per request or compiled into the container determines the cost — per-request loading adds I/O and parsing on every call unless cached per tenant. Tenant cardinality: high tenant counts multiply cache entries; a naive implementation produces cache-key sprawl or, worse, a single shared config cache that silently serves the wrong tenant's credentials. Validate the cache strategy under load with a realistic tenant count before committing.
Failure modes. Ranked by severity:
Ramp-up. Non-trivial for a Laravel team. Developers would need working knowledge of Symfony bundle registration, DI extensions, and the Config component's tree/merge semantics to debug issues — a skill set a Laravel team typically does not carry. The pattern-extraction route sidesteps this entirely and keeps the knowledge inside the team's existing competency. Estimated ramp-up for direct adoption: 1–2 weeks before a developer is productive in the bundle's internals; for pattern extraction: 3–5 days, using the repo only as a design reference.
Bottom line for the TPM: the composite score (0.66) reflects a usable idea with weak packaging. Recommend not adopting as a dependency in a Laravel codebase; authorize a short spike to extract the pattern, benchmark it against stancl/tenancy and spatie/laravel-multitenancy, and build natively. The only scenario favoring direct adoption is an existing Symfony service that needs this exact capability, where a pinned, vendored fork with a named owner is acceptable.
How can I help you explore Laravel packages today?