// the find
tenancy/multi-tenant
Run multiple websites using the same Laravel installation while keeping tenant specific data separated for fully independent multi-domain setups, previously github.com/hyn/multi-tenant
A Laravel package for running multiple websites from a single codebase, with per-tenant database separation, filesystem isolation, and optional webserver config generation. Targets SaaS builders and agencies reusing a Laravel app across clients or domains. It's the older hyn/multi-tenant package that moved orgs.
Event-driven architecture means you can hook into tenant lifecycle (created, switched, deleted) without patching the package itself. Three database separation strategies (separate DBs, table prefixes, or DIY via events) gives real flexibility instead of forcing one model. Includes Nginx/Apache vhost generation, which is a detail most multi-tenancy packages skip and leave to you. Test coverage is broad — commands, middleware, filesystem, queue — and tests hit real databases rather than mocking connections.
The package predates Laravel's first-class multi-tenancy story and shows it — the WebsiteRepository/HostnameRepository abstractions are a lot of ceremony compared to what newer packages (stancl/tenancy) do with less friction. Webserver integration writing config files to disk is a 2017 pattern that breaks in containerized or serverless deployments; you'll just disable it. The README links to tenancy.dev for docs but that site has been unreliable, and the changelog is sparse — debugging why a tenant switch silently fails means reading source. Last real activity slowed considerably after 2021 despite the recent push date.