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 Tenant Bundle

Multi Tenant Bundle Laravel Package

syndicatetheory/multi-tenant-bundle

A Symfony bundle for multi-tenant PHP applications, providing tenant-aware configuration and infrastructure to isolate data and serve multiple customers from one codebase, simplifying SaaS architecture.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Multi Tenant Bundle
Can I use syndicatetheory/multi-tenant-bundle in a Laravel application?
No. This package is a Symfony2 bundle, not a Laravel package, and bundles cannot be autoloaded into Laravel's service provider lifecycle or registered through Composer in a Laravel app. There is no shared extension mechanism to bridge the two, so it is a non-starter for a Laravel stack regardless of configuration. If your target is Laravel, treat this as a categorization error rather than a candidate dependency.
Why doesn't this Symfony bundle work with Laravel?
Symfony bundles register compiler passes, DI extensions and kernel event listeners, none of which exist in Laravel. Laravel uses service providers, container bindings, middleware and bootstrappers instead. Every concept in the bundle would need to be re-expressed against those primitives, which makes it a rewrite rather than an integration.
Is syndicatetheory/multi-tenant-bundle still maintained?
There is no meaningful maintenance surface. The repository shows roughly 13 stars and 0 dependents, and the maintainer has labelled it IN DEVELOPMENT, which is their own status signal rather than a community inference. Symfony 2.x reached end of life in 2018, with 2.8 extended support ending in November 2019. That combination means no ecosystem pressure, no downstream forks of consequence and nobody obligated to patch a tenant-isolation defect.
What Laravel packages should I use instead for multi-tenancy?
For a Laravel target, stancl/tenancy and spatie/laravel-multitenancy are the maintained, tested implementations of exactly these concerns. Both have active issue trackers and documented strategies for tenant resolution, connection switching, migrations and cache isolation. Choosing between them usually comes down to whether you want database-per-tenant automation or a lighter single-database approach.
Which tenancy model should I choose: database-per-tenant, schema-per-tenant, or shared schema with tenant_id?
Database-per-tenant gives the strongest isolation and the simplest per-tenant backup and restore story, at the cost of more connections and migration fan-out. Schema-per-tenant sits in between and suits PostgreSQL well. Shared schema with a tenant_id column is the cheapest to operate but pushes isolation responsibility into every query and every developer, so it demands strict scoping and disciplined testing.
How do I resolve the current tenant in a Laravel application?
Use middleware that identifies the tenant from the request host or subdomain, a path prefix, a header or the authenticated user's membership, then binds that tenant into the container for the request lifetime. Keep resolution request-scoped rather than global so queued jobs and console commands can set tenant context explicitly. Avoid deriving the tenant from session state alone, since that is fragile across stateless API calls.
How do I run per-tenant migrations in Laravel?
Write an Artisan command that iterates your tenants and runs the migrator against each tenant connection in turn. Track migration state per tenant using the migrations table on each connection, or a central table that records which tenants have received which batch. Avoid running one global migration against a shared schema unless you have deliberately chosen the tenant_id model.
How do I isolate cache, filesystem and queues per tenant in Laravel?
Prefix cache keys with the tenant identifier, resolve a per-tenant disk root for filesystem operations, and include the tenant ID in job payloads so workers can re-establish context before handling them. Connection switching on tenant boot usually means mutating runtime config and calling DB::purge() so pooled connections do not leak across tenants. Queue workers are the most common source of leakage because they outlive the request that dispatched the job.
Can I port a Symfony bundle's tenancy logic to Laravel instead of rewriting it?
Not incrementally. You cannot phase a Symfony2 bundle into a Laravel application because there is no shared extension surface to port against. The honest path is concept transfer: extract the tenancy model from the design, then implement it against Laravel's native primitives. Budget that as a feature build, not an integration.
How should I test for cross-tenant data leakage?
Write tests that authenticate as tenant A, attempt to read or write tenant B's records, and assert a 404 or empty result rather than a 403 that confirms existence. Cover the paths that bypass request middleware: queued jobs, scheduled commands, notifications, exports and any raw query builder calls. Run the same assertions against cache reads and file downloads, since those are isolated separately from the database.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console