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

Multi Tenancy Bundle Laravel Package

hakam/multi-tenancy-bundle

Hakam Multi-Tenancy Bundle is a Laravel package for adding multi-tenant support with tenant-aware database connections, migrations, and configuration, helping isolate tenant data and simplify managing multiple tenants in one application.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit — poor as-is, instructive as a reference. The package is a Symfony bundle (hakam/multi-tenancy-bundle), which is structurally incompatible with a Laravel application. Symfony bundles ship a Bundle subclass, a DI Extension, compiler passes, and event subscribers wired through the Symfony kernel; Laravel has no equivalent loading mechanism. Laravel's analogues are service providers, middleware, and container bindings. Adopting this package in a Laravel codebase is not a configuration exercise — it is a rewrite of the integration layer, and probably of the package internals.

What does transfer is the domain model. Multi-tenancy decomposes into the same concerns in either framework: tenant resolution (domain, subdomain, header, path), tenant identification and caching, connection/DB switching, and isolation of cross-cutting state (cache, filesystem, queue, sessions, config, logs). This bundle can serve as a design reference and a checklist for what a Laravel implementation must cover, particularly around connection lifecycle and per-request tenant context.

Integration feasibility — low for direct dependency, moderate for conceptual reuse. Directly requiring this package in a Laravel app yields nothing loadable and adds a dormant dependency with supply-chain surface and no runtime value. A shim (porting the bundle's services into service providers) is feasible but only rational if the bundle's tenancy logic is genuinely differentiated. Given 133 stars and 0 dependents, there is no evidence base that its design decisions have survived contact with production traffic at any scale.

Technical risk — high, concentrated in data isolation. Multi-tenancy is a security-boundary concern: a defect is not a bug, it is cross-tenant data leakage. Risk factors:

  • Unproven in the wild. Zero dependents means no downstream users discovering edge cases. A package with 133 stars and no adopters is effectively a personal project.
  • Single-maintainer bus factor. No organizational backing; abandonment risk is real.
  • Release signal ambiguity. The last release is dated 2026-04-26, which is either a forward-dated tag, a metadata error, or a sign of unusual release hygiene. Either way it needs verification before it factors into a decision.
  • Framework boundary. Any cross-framework port means the ported code is ours to own and secure, not the maintainer's, while still inheriting upstream design constraints.

Key questions for the maintainer / spike:

  1. Which tenancy model is assumed — database-per-tenant, schema-per-tenant, or shared-schema with a tenant column? Does it support mixed models?
  2. How is tenant resolution performed, and is resolution pluggable (subdomain vs. custom domain vs. JWT claim)?
  3. How is tenant context propagated to async work — queued jobs, scheduled commands, long-running workers — and is context explicitly reset between units of work?
  4. What happens on connection failure mid-request, and is there a documented tenant-context teardown path?
  5. Is there a test suite, CI, and static analysis? What is the PHP/Symfony version support matrix?
  6. Who maintains it, what is the commit cadence, and are there published security practices?

Integration Approach

Stack fit — mismatch. If the target platform is Laravel, this package is out of scope as a runtime dependency. If the organization also operates Symfony services, this bundle becomes a candidate there and should be evaluated on its own merits against those services' version constraints.

Recommended path — use as reference, not dependency. Three options, in order of preference:

Option Description Verdict
A. Laravel-native adoption Evaluate stancl/tenancy or spatie/laravel-multitenancy against the requirements checklist derived from this bundle Preferred
B. Reference-based in-house build Extract the bundle's tenancy model as a spec; implement with Laravel middleware + service providers Viable if requirements are unusual
C. Port the bundle Reimplement its services as Laravel providers Only if the bundle contains logic we cannot source elsewhere

In all cases the bundle's value is the requirements checklist, not the code.

Compatibility. Confirm PHP version floor, Symfony major version, and whether the tenancy mechanism depends on Symfony-specific HTTP kernel events or Doctrine DBAL connection hooks. Doctrine coupling matters: if the bundle drives tenancy by swapping Doctrine connections, that logic maps to Laravel's connection resolver but not cleanly, and the mapping should be validated in a spike rather than assumed.

Sequencing.

  1. Requirements spike (1 week). Enumerate isolation requirements: which resources are tenant-scoped (DB, cache, object storage, queue, search index, logs, sessions)? Derive acceptance criteria.
  2. Threat model. Explicitly define what "leakage" means per resource and how it would be detected in tests.
  3. Comparative evaluation. Score this bundle's model, the Laravel-native options, and an in-house build against the criteria from step 1.
  4. Non-production pilot. Single tenant class, canary environment, isolation test suite that attempts cross-tenant access on every resource.
  5. Progressive rollout. Expand tenant classes only after the isolation suite passes and observability for tenant context is in place.

Operational Impact

Maintenance. Direct adoption transfers an unmaintained-risk dependency into a critical security path. Even in the reference-only path, the cost is bounded: a one-time spike plus a written spec, with no ongoing dependency obligation. This is the strongest argument for the reference approach — it captures the design value and discards the lifecycle risk.

Support. No vendor, no SLA, community-only. With 0 dependents there is no peer community to draw on for incident response. Any production issue in a directly-adopted scenario is resolved by us, against code we did not write. Budget accordingly: assume we own it from day one.

Scaling. The operational scaling characteristics that matter are tenant count, per-tenant migration and provisioning time, and connection pool pressure. A database-per-tenant model multiplies connection overhead by tenant count and makes migrations an N-step operation that must be orchestrated, idempotent, and observable. None of these concerns are solved by the bundle's abstractions alone; they are platform engineering work regardless of which implementation is chosen.

Failure modes — the ones to instrument for:

  • Context leakage. Request handled with a stale or default tenant; the highest-severity failure. Mitigate with explicit context teardown and a test that asserts the default tenant is never served implicitly.
  • Worker contamination. Queue workers retaining tenant context across jobs in a long-running process. Mitigate with per-job context hydration and an assertion at job dispatch.
  • Cache/storage cross-contamination. Keys or paths not namespaced by tenant. Mitigate with cache-key prefixing enforced at the framework layer, not per-call.
  • Migration drift. A tenant left on an old schema after a failed provisioning or migration run. Mitigate with a tenant-migration status ledger and alerting.
  • Connection exhaustion. Pool starvation at high tenant density; surfaces as latency, then 5xx.

Ramp-up. The team's Laravel fluency does not transfer to a Symfony bundle — subscribers, compiler passes, and DI extension semantics are unfamiliar surface area, and debugging them adds latency to every incident. The Laravel-native alternatives cost materially less to onboard because they use primitives the team already knows. Estimated ramp-up: days for a Laravel-native package versus weeks for a Symfony bundle port, with the port also carrying permanent ownership.

Bottom line. Treat this package as an architecture reference, not a dependency. Its score and zero-dependency count do not support production adoption on a security-boundary concern, and its framework is a structural mismatch for a Laravel target. Run the requirements spike, use the bundle to pressure-test the checklist, and adopt or build on Laravel-native primitives.

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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager