Download the PHP package dazza-dev/hyn-multi-tenant without Composer
On this page you can find all versions of the php package dazza-dev/hyn-multi-tenant. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dazza-dev/hyn-multi-tenant
More information about dazza-dev/hyn-multi-tenant
Files in dazza-dev/hyn-multi-tenant
Package hyn-multi-tenant
Short Description Maintained continuation of hyn/multi-tenant with Laravel 11 support. Run multiple websites on a single Laravel installation while keeping each tenant's data separated.
License MIT
Informations about the package hyn-multi-tenant
dazza-dev/hyn-multi-tenant
Run multiple websites from a single Laravel installation, each with one or more hostnames, keeping their data, assets and behaviour separated.
Which version do you need?
| Your Laravel version | What to use |
|---|---|
| 12 and 13 | dazza-dev/hyn-multi-tenant — this package |
| 11 | The 1.x line, in maintenance: security and isolation fixes only |
| 9 and 10 | The 0.x line, which continues hyn/multi-tenant 5.9 |
Every line is on Packagist under the same name:
About this repository
A maintained fork of hyn/multi-tenant by Daniël Klabbers. The design and practically all of the code are his and the original contributors'.
The original has received no commits since August 2023 and does not support
Laravel 11. Rather than migrate away, we picked up its maintenance. This is the
same code, the same Hyn\Tenancy\ namespace and the same API.
If the original project becomes active again we will gladly contribute these changes back.
Features
- Event driven, extensible architecture.
- Optional integration with nginx and apache.
- Tenant specific configuration, routes, views, translations and assets.
Tenant separation modes:
- A separate database per tenant, with its own user and credentials (default).
- A table prefix within the system database.
- Separate PostgreSQL schemas.
- Or your own, by listening to an event.
Requirements
- Laravel 12 or 13
- PHP 8.2 or newer. Laravel 13 itself asks for 8.3, so on 8.2 you get Laravel 12
- MySQL, MariaDB or PostgreSQL
Installation
Coming from hyn/multi-tenant, read UPGRADE.md first. The
namespace does not change.
The service providers are registered through package auto discovery. To opt out
and register them yourself, add dazza-dev/hyn-multi-tenant to
extra.laravel.dont-discover and register:
Configuration
Adjust config/tenancy.php and config/webserver.php to taste. Make sure the
system connection is configured in database.php; the default connection is
used unless you override the system connection name.
Documentation
The original documentation applies to everything not listed as changed in UPGRADE.md.
Contributing, and what the test suite needs: CONTRIBUTING.md.
Testing
The suite creates and drops real databases and database users, so it needs a disposable environment. One matching CI is included:
Target another engine or separation mode:
Build against another PHP version with PHP_VERSION=8.4 docker compose build php.
The suite runs on 8.2, 8.3 and 8.4.
Running the suite drops tenant and system databases. Never point it at anything you care about.
Credits
- Daniël Klabbers — author of the original package.
- Contributors to the original project.
- Andres Daza — maintainer of this continuation.
To support the original author's work, the original project has an Open Collective.
License
MIT. Original copyright by Daniël Klabbers — see license.md.