tenancy/multi-tenant ships as hyn/multi-tenant and its test suite drops your databases
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
At a glance
- What is it?
- A Laravel package for serving many sites from one codebase, offering three database separation strategies, a web server integration you can turn off, and a documented test command that resets the application it runs in.
- Who is it for?
- This package fits a Laravel application that must serve several customer sites from one codebase and wants per tenant data in separate databases rather than a shared schema. Read three things before you adopt it.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 169 days ago.
- What is it written in?
- Mainly PHP, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- tenancy/multi-tenant2,604 ★ · -1
| Repository | 2026-09-29 | 2026-11-15 |
|---|---|---|
| tenancy/multi-tenant | 2.6k | 2.6k |
-1 Stars in the last 47 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The package still installs as hyn/multi-tenant after the repository moved
The repository lives under the tenancy organisation, and its own description records a move from the older address, but the name you type has not changed.
composer require hyn/multi-tenantThe vendor prefix stays `hyn`, which means the same old name appears in the Composer package, in the Packagist badge, and in the provider classes you register by hand, where the namespace begins `Hyn\Tenancy\`. Three different identities for one project is a recurring theme here, and the practical effect lands on automation: any script that derives a Composer name from a GitHub organisation will look for `tenancy/multi-tenant`, which is not what the registry serves. The default branch is also not the usual one, since it is `5.x`, so a clone without arguments lands on a version line rather than on a main branch.
Four organisation names show up in one page of badges
The badge row at the top of the document is a small map of the project's history. The Packagist badge points at the `hyn/multi-tenant` package, the CircleCI badge at `tenancy/multi-tenant`, the Codecov badge at `tenancy/multi-tenant` with a branch of `5.x` pinned in the URL, and the Codacy badge at an application under `Luceos`. Further down, the contributors block links to eight Sourcerer pages on a path that contains both `luceos` and `hyn`. So the same repository is known as tenancy, hyn, and luceos in three different services, plus the Composer vendor as a fourth identity, and the contributor links still carry two of the older names. The document file itself is even named `readme.md` in lowercase, while the badge block above it is the part most likely to be quoted elsewhere. None of that breaks anything, but it does mean a badge can report on a project that no longer exists under that path.
Three ways to separate tenant data, and the third one is yours to write
The separation strategy is the decision the package asks you to make first. Three options are on offer. The default is one system database plus a separate database per tenant, which keeps each customer's rows in their own schema and makes a per tenant query simple. The second puts every tenant in the system database with a table prefix, which keeps one connection and one backup path at the cost of isolation. The third is written as manually, the way you want, by listening to an event, and that phrasing matters: the third option is not a preset but a hook, so the layout you end up with is whatever your listener builds. The package also lets you add tenant specific configs, code, and routes, so the boundary between shared and tenant owned code is a design decision rather than a fixed structure. One more offer in the same list is worded oddly enough to be worth quoting, since it describes the web server integration as close, optional, and integrated, which is the only place in the document that hedges about a feature it also lists as a headline. The stated audience is marketing companies reusing one codebase for different clients, and start-ups selling the next piece of software as a service.
Turning off auto discovery means registering two providers yourself
Laravel discovers the package on its own, so the normal path needs nothing beyond the install. The manual path exists for two reasons given in the document: to disable web server integration, or simply to prefer doing it by hand. Opting out means adding the package to a `dont-discover` array in your Composer file.
{
"extra": {
"laravel": {
"dont-discover": [
"hyn/multi-tenant"
]
}
}
}Then both providers have to be listed in `config/app.php`, the tenancy provider and the webserver provider, since the second one carries the optional web server integration on its own.
'providers' => [
// [..]
// Hyn multi tenancy.
Hyn\Tenancy\Providers\TenancyProvider::class,
// Hyn multi tenancy webserver integration.
Hyn\Tenancy\Providers\WebserverProvider::class,
],Deployment ends with migrations aimed at a named system connection
Publishing the configuration and the migrations is one command, after which two files are yours to edit.
php artisan vendor:publish --tag tenancyThose are `config/tenancy.php` and `config/webserver.php`. The one trap the document calls out is the connection: the system connection has to be configured in `database.php`, and if you have not overridden the system connection name then the `default` connection is used. That single sentence decides which database gets your tenancy tables, and the migrations are then aimed at it by name.
php artisan migrate --database=systemEverything else in the package hangs off that connection: it holds the tenant registry, and the tenant databases hang off it in turn, which is why the system connection has to exist before any tenant can.
The documented test command resets the application it runs in
The testing section is short and its warning is the important part.
vendor/bin/phpunitOn MySQL the same command carries an environment variable in front of it, `LIMIT_UUID_LENGTH_32=1`, which changes how identifiers are generated for that engine. Under both, the document warns that running the tests will reset your current application completely, dropping tenant and system databases and removing the `tenancy.json` file from the Laravel directory. That is not a temporary test schema, it is your configured environment, and the only thing standing between it and production is which configuration file phpunit loads. The repository holds two PHPUnit configurations, `phpunit.xml` and `ci.phpunit.xml`, which is how the continuous integration run keeps its destructive suite away from a developer's local databases, and the `.circleci/` and `.codecov.yml` files at the root show the pipeline that runs it and collects coverage.
Tags stopped at 5.9.1 in 2023 while the branch kept committing
The release list has three entries: 5.8.0 in April 2022 adding Laravel 9 support, 5.9.0 in July 2023 adding Laravel 10 support, and 5.9.1 in August 2023 for Laravel 9 backward compatibility. The default branch was last pushed on 2026-05-30 and the repository is not archived, so there is a gap of nearly three years between the newest tag and the newest commit. That gap is the decision a new user has to make, because Composer gives you the tag unless you ask for a branch, and the requirements section meanwhile asks for Laravel 9.0 or newer with PHP 8.0 or newer on Apache or Nginx with MySQL, MariaDB, or PostgreSQL. The link offered for the full requirements points at the documentation for version 5.4, an older line than any of the three tags above. The change history is kept in `changelog.md` at the root, and the document closes with contact routes rather than a migration guide: an email address taken from the Composer file, a Discord channel, and a Twitter account for the project.
Editorial conclusion
This package fits a Laravel application that must serve several customer sites from one codebase and wants per tenant data in separate databases rather than a shared schema. Read three things before you adopt it. The Composer name is still hyn/multi-tenant with a Hyn namespace even though the repository has moved, so tooling that guesses names from the organisation will look for the wrong thing. The newest tag is 5.9.1 from 2023-08-18 while the branch moved on 2026-05-30, so decide deliberately whether you want that tag or branch head. And never run the test command against an environment holding real data, because the documented behaviour is to drop tenant and system databases and delete tenancy.json.
Frequently asked questions
How do I install the tenancy multi-tenant package?
Run `composer require hyn/multi-tenant`. Laravel package auto discovery then registers it automatically. To opt out, add `hyn/multi-tenant` to the `dont-discover` array under `extra.laravel` in your composer.json and register the tenancy and webserver providers yourself in `config/app.php`.
Which database separation methods does tenancy multi-tenant offer?
Three. The default is one system database with separated tenant databases, the second is table prefixes inside the system database, and the third is a manual approach implemented by listening to an event, which leaves the layout to your own listener.
What happens when I run the tenancy multi-tenant test suite?
The README warns that it resets your current application completely, dropping tenant and system databases and removing tenancy.json from the Laravel directory. On MySQL the command is run with `LIMIT_UUID_LENGTH_32=1` set in front of phpunit.
What does tenancy multi-tenant require?
Laravel 9.0 or newer, PHP 8.0 or newer, Apache or Nginx, and MySQL, MariaDB, or PostgreSQL. The requirements link in the README points at the documentation for version 5.4, while the newest release tag is 5.9.1.
Which Composer package name installs this project?
The Composer package is still `hyn/multi-tenant`, and the provider classes keep the `Hyn\Tenancy` namespace, even though the repository now lives under the tenancy organisation and its description records a move from the earlier address. The default branch is `5.x`.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/tenancy-multi-tenant)Star history chart for your README
[](https://hysenlabs.com/projects/tenancy-multi-tenant)Was this useful?