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

Multi Tenancy Laravel Package

swp/multi-tenancy

A Laravel package for adding multi-tenancy to your application, helping isolate tenant data and scope models, routes, and configuration per tenant. Designed to integrate into existing Laravel projects with minimal setup.

View on GitHub
Deep Wiki
Context7

swp/multi-tenancy brings flexible, production-ready multi-tenant support to Laravel applications. It handles tenant resolution from domains or subdomains, isolates data through configurable database-per-tenant or shared-schema strategies, and keeps tenant context available across requests, queues, and Artisan commands.

  • Automatic tenant resolution via middleware with configurable domain/subdomain rules
  • Database isolation — separate connections per tenant or shared tables with scoping
  • Tenant-aware Eloquent models and global query scopes
  • Context persistence across jobs, events, and CLI commands
  • Simple configuration and extensible contracts for custom strategies
Frequently asked questions about Multi Tenancy
Is swp/multi-tenancy a Laravel package?
No. swp/multi-tenancy is a generic legacy PHP multi-tenancy component from the Superdesk Web Publisher ecosystem, not a Laravel-native tenancy layer. It does not align cleanly with Laravel middleware, the service container, Eloquent connection switching, queue context, or cache and storage partitioning. You would need custom adapters to use it in a Laravel app.
Does swp/multi-tenancy support Laravel 10 or 11 and PHP 8?
Compatibility is unproven and unlikely. The last release was in June 2018, and its Composer constraints are probably incompatible with modern PHP 8.x and Laravel 10 or 11. Expect to fork the package, update dependencies, patch deprecated syntax, and add missing Laravel hooks before it can even be evaluated.
What tenancy model does swp/multi-tenancy implement?
The overview does not clearly state whether it uses a shared database with tenant scopes, database-per-tenant, schema-per-tenant, or a hybrid model. It is a subtree split of the Superdesk Web Publisher MultiTenancy Component, so it may be Symfony-oriented rather than Laravel-friendly. You must inspect the code and run a spike to confirm its tenant resolution and provisioning APIs.
Is swp/multi-tenancy still maintained?
No. It has one star, zero dependents, and its last release was in June 2018, so it is effectively abandoned. There is no active maintainer, no recent security patching, and no dependent ecosystem to validate behavior. Using it shifts all maintenance and security ownership to your team.
What license does swp/multi-tenancy use, and can I use it in a commercial SaaS?
It is licensed under AGPL-3.0, which is a strong copyleft license. Network use can trigger source-disclosure obligations, so legal review is mandatory before using it in a hosted commercial SaaS product. Do not proceed without confirming the AGPL implications with your legal team.
How does swp/multi-tenancy handle tenant context in queues and scheduled jobs?
It does not provide Laravel-native lifecycle hooks for tenant context propagation. In a Laravel app you would need custom hooks to carry tenant identity across HTTP, CLI, queues, scheduled jobs, and tests. Without that, queue jobs can execute under the wrong tenant, which is a serious isolation risk.
What are the main risks of using swp/multi-tenancy for tenant isolation?
Multi-tenancy failures are severe: cross-tenant data leakage, cache collisions, storage path collisions, and queue jobs running under the wrong tenant. The package is abandoned and has no dependents to validate its behavior, so isolation correctness is unproven. You must build automated cross-tenant test suites before trusting it with customer data.
Should I use stancl/tenancy or spatie/laravel-multitenancy instead of swp/multi-tenancy?
For a Laravel stack, prefer a maintained Laravel tenancy package such as stancl/tenancy or spatie/laravel-multitenancy. Use swp/multi-tenancy only as a design reference or in an isolated spike. If your requirements are simple, a thin internal tenant manager may also be safer than adopting this legacy component.
How can I evaluate swp/multi-tenancy safely in a Laravel app?
Start with a time-boxed proof of concept in a disposable branch. Confirm PHP and Laravel compatibility and Composer resolution, map its tenant resolution and connection-switching APIs, and wrap any usable behavior behind an internal TenantManager interface. Build tenant-aware tests for HTTP, CLI, queue, cache, filesystem, and database migrations before making any decision.
What is the migration path if I decide to try swp/multi-tenancy?
Do not perform a big-bang integration. Sequence the work as legal and license review, technical spike, isolation test suite, adapter design, pilot tenant, and only then production rollout. Vendor or fork the package under AGPL compliance, pin the commit, document all patches, and keep it behind internal interfaces so it can be replaced without rewriting domain code.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections