PHPackages                             achalj09/multi-tenant - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. achalj09/multi-tenant

ActiveLibrary[Framework](/categories/framework)

achalj09/multi-tenant
=====================

Run multiple websites using the same laravel installation while keeping tenant specific data separated for fully independant multi-domain setups.

5.7.1(5y ago)03MITPHPPHP ^7.3

Since May 12Pushed 5y agoCompare

[ Source](https://github.com/achalj09/multi-tenant)[ Packagist](https://packagist.org/packages/achalj09/multi-tenant)[ RSS](/packages/achalj09-multi-tenant/feed)WikiDiscussions 5.x Synced today

READMEChangelogDependencies (9)Versions (142)Used By (0)

[![Packagist](https://camo.githubusercontent.com/22e02a91b0d56fa6de95a1449c4fc36ae88e30b9fd3610beb44d76346aac3301/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68796e2f6d756c74692d74656e616e742e737667)](https://packagist.org/packages/hyn/multi-tenant)[![build status](https://camo.githubusercontent.com/06bef5964c9e9d08a654b8531636bd9b0ce99733e282f336944455b3d4fcd43b/68747470733a2f2f636972636c6563692e636f6d2f67682f68796e2f6d756c74692d74656e616e742e7376673f7374796c653d737667)](https://circleci.com/gh/hyn/multi-tenant)[![codecov](https://camo.githubusercontent.com/3cf54a8592fe4afce1552e09b001f825bbf91e5b4dd8136cb5496b57830b0b0f/68747470733a2f2f636f6465636f762e696f2f67682f68796e2f6d756c74692d74656e616e742f6272616e63682f352e782f67726170682f62616467652e737667)](https://codecov.io/gh/hyn/multi-tenant/branch/5.x)[![Packagist](https://camo.githubusercontent.com/6c575ed3577a5bb9fd513c9a3cd75f175eef57b73e0c75af20f661a1b5d99c47/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68796e2f6d756c74692d74656e616e742e737667)](https://packagist.org/packages/hyn/multi-tenant)[![Codacy Badge](https://camo.githubusercontent.com/6a94d6058715ebede650aca36d8368ccb357b3861a313dc820dfdf340bda5245/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f61633365323164376135663634653366383766363463343931336331636130393f6272616e63683d342e78)](https://www.codacy.com/app/Luceos/multi-tenant)[![Join our Discord server](https://camo.githubusercontent.com/79e5c386b9cc3e9b6b40689f9f6fd66ea4d47382127fce5f30ca28891e441f59/68747470733a2f2f646973636f72646170702e636f6d2f6170692f6775696c64732f3134363236373739353735343035373732392f656d6265642e706e67)](https://tenancy.dev/chat)[![Mentioned in Awesome Laravel](https://camo.githubusercontent.com/1667baa3145a7b9b2a0ae17d8c7b09b4d471f79aa02b0615ab07d64d9988a198/68747470733a2f2f617765736f6d652e72652f6d656e74696f6e65642d62616467652e737667)](https://github.com/chiraggude/awesome-laravel)

The unobtrusive Laravel package that makes your app multi tenant. Serving multiple websites, each with one or more hostnames from the same codebase. But with clear separation of assets, database and the ability to override logic per tenant.

Suitable for marketing companies that like to re-use functionality for different clients or start-ups building the next software as a service.

---

Offers:

- Integration with the awesome Laravel framework.
- Event driven, extensible architecture.
- Close - optional - integration into the web server.
- The ability to add tenant specific configs, code, routes etc.

Database separation methods:

- One system database and separated tenant databases (default).
- Table prefixed in the system database.
- Or .. manually, the way you want, by listening to an event.

[Complete documentation](https://tenancy.dev) covers more than just the installation and configuration.

Requirements, recommended environment
-------------------------------------

[](#requirements-recommended-environment)

- Laravel 8.0+.
- PHP 7.3+
- Apache or Nginx.
- MySQL, MariaDB, or PostgreSQL.

Please read the full [requirements in the documentation](https://tenancy.dev/docs/hyn/5.4/requirements).

Installation
------------

[](#installation)

```
composer require hyn/multi-tenant
```

### Automatic service registration

[](#automatic-service-registration)

Using [auto discovery](https://medium.com/@taylorotwell/package-auto-discovery-in-laravel-5-5-ea9e3ab20518), the tenancy package will be auto detected by Laravel automatically.

#### Manual service registration

[](#manual-service-registration)

In case you want to disable webserver integration or prefer manual integration, set the `dont-discover` in your application composer.json, like so:

```
{
    "extra": {
        "laravel": {
            "dont-discover": [
                "hyn/multi-tenant"
            ]
        }
    }
}
```

If you disable auto discovery you are able to configure the providers by yourself.

Register the service provider in your `config/app.php`:

```
    'providers' => [
        // [..]
        // Hyn multi tenancy.
        Hyn\Tenancy\Providers\TenancyProvider::class,
        // Hyn multi tenancy webserver integration.
        Hyn\Tenancy\Providers\WebserverProvider::class,
    ],
```

### Deploy configuration

[](#deploy-configuration)

First publish the configuration and migration files so you can modify it to your needs:

```
php artisan vendor:publish --tag tenancy
```

Open the `config/tenancy.php` and `config/webserver.php` file and modify to your needs.

> Make sure your system connection has been configured in `database.php`. In case you didn't override the system connection name the `default` connection is used.

Now run:

```
php artisan migrate --database=system
```

This will run the required system database migrations.

---

Backers
-------

[](#backers)

Thank you to all our backers! 🙏 \[[Become a backer](https://opencollective.com/tenancy#backer)\]

[![](https://camo.githubusercontent.com/2544ce18348fcea26928c8c1ef8fbf99256a66941d186dfdb83a4ae700954a98/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f74656e616e63792f6261636b6572732e7376673f77696474683d383930)](https://opencollective.com/tenancy#backers)

Sponsors
--------

[](#sponsors)

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. \[[Become a sponsor](https://opencollective.com/tenancy#sponsor)\]

[![](https://camo.githubusercontent.com/fdec2388e4df76695a1e6ca20fdafee0f8c345eaf339f5dfbf606a7a0a54dc10/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f74656e616e63792f73706f6e736f722f302f6176617461722e737667)](https://opencollective.com/tenancy/sponsor/0/website)[![](https://camo.githubusercontent.com/43c5678c1603b9ba7d372cc2293442d4a21587eb76eb43d5d3c1442b5bce11fa/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f74656e616e63792f73706f6e736f722f312f6176617461722e737667)](https://opencollective.com/tenancy/sponsor/1/website)[![](https://camo.githubusercontent.com/19398d666ea72931ddd15907f3acd18501e5c31210ca91737b93a326ec59a703/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f74656e616e63792f73706f6e736f722f322f6176617461722e737667)](https://opencollective.com/tenancy/sponsor/2/website)[![](https://camo.githubusercontent.com/5959a0f518f520f7c903e617544d32a90bd05dabe55bd63e8670016c8d5f59f9/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f74656e616e63792f73706f6e736f722f332f6176617461722e737667)](https://opencollective.com/tenancy/sponsor/3/website)[![](https://camo.githubusercontent.com/d2b24cc85ee090c9ccec793b3379dc5a319717d212fbda3e4c25206bbdd37a53/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f74656e616e63792f73706f6e736f722f342f6176617461722e737667)](https://opencollective.com/tenancy/sponsor/4/website)[![](https://camo.githubusercontent.com/e32a7a8a299d3d1f255fe5d8e0017574ec70686ce0b3f8a8b260e2b3c824f062/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f74656e616e63792f73706f6e736f722f352f6176617461722e737667)](https://opencollective.com/tenancy/sponsor/5/website)[![](https://camo.githubusercontent.com/4a78f03581fec2a3a9f351136e9e15ce58d831efeb957a75e8b7cab143ce3052/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f74656e616e63792f73706f6e736f722f362f6176617461722e737667)](https://opencollective.com/tenancy/sponsor/6/website)[![](https://camo.githubusercontent.com/a5ce8da11b480fb6e192150fde9b354edf377981828079769733738e50f7947d/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f74656e616e63792f73706f6e736f722f372f6176617461722e737667)](https://opencollective.com/tenancy/sponsor/7/website)[![](https://camo.githubusercontent.com/0650ae9506145bef604f51896ae5be5d0b8dfd62cc43681583dd1f53b84947b6/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f74656e616e63792f73706f6e736f722f382f6176617461722e737667)](https://opencollective.com/tenancy/sponsor/8/website)[![](https://camo.githubusercontent.com/02497c2c17aa3fcc1408f46888d3cb1f2117e6a51a222cdbe0da15e77c046256/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f74656e616e63792f73706f6e736f722f392f6176617461722e737667)](https://opencollective.com/tenancy/sponsor/9/website)

Contributors
------------

[](#contributors)

[![](https://camo.githubusercontent.com/de1bae5ddc5e524865837a5867234b353045b846fd0d8969ba42d58c1d70ee25/68747470733a2f2f736f757263657265722e696f2f66616d652f6c7563656f732f68796e2f6d756c74692d74656e616e742f696d616765732f30)](https://sourcerer.io/fame/luceos/hyn/multi-tenant/links/0)[![](https://camo.githubusercontent.com/65599db649f1150f1ebdaba2b407b3ef3f337dedc8148e57b8cc0a13d0ed78e8/68747470733a2f2f736f757263657265722e696f2f66616d652f6c7563656f732f68796e2f6d756c74692d74656e616e742f696d616765732f31)](https://sourcerer.io/fame/luceos/hyn/multi-tenant/links/1)[![](https://camo.githubusercontent.com/f5bda167eccc62de47f0fa26e6e60c627c1322c95d23bb7cac2658b8fda59b7a/68747470733a2f2f736f757263657265722e696f2f66616d652f6c7563656f732f68796e2f6d756c74692d74656e616e742f696d616765732f32)](https://sourcerer.io/fame/luceos/hyn/multi-tenant/links/2)[![](https://camo.githubusercontent.com/521fd653ce281e9e424bf94ea386c0a80df8a1499666c18a2890b0a495f2d643/68747470733a2f2f736f757263657265722e696f2f66616d652f6c7563656f732f68796e2f6d756c74692d74656e616e742f696d616765732f33)](https://sourcerer.io/fame/luceos/hyn/multi-tenant/links/3)[![](https://camo.githubusercontent.com/022ad908fc5f2c5995efe3cad0ffc73d018e0e8e0bbe9add2e7ab6ad2a5c7ec1/68747470733a2f2f736f757263657265722e696f2f66616d652f6c7563656f732f68796e2f6d756c74692d74656e616e742f696d616765732f34)](https://sourcerer.io/fame/luceos/hyn/multi-tenant/links/4)[![](https://camo.githubusercontent.com/0adddb13e2df1bd4c52eaa3cf2b07cd5a917888fcddb1f89fd40f30ef0e06295/68747470733a2f2f736f757263657265722e696f2f66616d652f6c7563656f732f68796e2f6d756c74692d74656e616e742f696d616765732f35)](https://sourcerer.io/fame/luceos/hyn/multi-tenant/links/5)[![](https://camo.githubusercontent.com/be7b9093152a74dfbd4b96691826ecc80fce50fe1a7a19400e881cbf9947f251/68747470733a2f2f736f757263657265722e696f2f66616d652f6c7563656f732f68796e2f6d756c74692d74656e616e742f696d616765732f36)](https://sourcerer.io/fame/luceos/hyn/multi-tenant/links/6)[![](https://camo.githubusercontent.com/9a36177aaeda3661848b2da90d33320823d069dcc6b5e2fb2f7d40adfef010f7/68747470733a2f2f736f757263657265722e696f2f66616d652f6c7563656f732f68796e2f6d756c74692d74656e616e742f696d616765732f37)](https://sourcerer.io/fame/luceos/hyn/multi-tenant/links/7)

---

License and contributing
------------------------

[](#license-and-contributing)

This package is offered under the [MIT license](license.md). In case you're interested at contributing, make sure to read the [contributing guidelines](.github/CONTRIBUTING.md).

### Testing

[](#testing)

Run tests using:

```
vendor/bin/phpunit
```

If using MySQL, use:

```
LIMIT_UUID_LENGTH_32=1 vendor/bin/phpunit
```

> Please be warned running tests will reset your current application completely, dropping tenant and system databases and removing the tenancy.json file inside the Laravel directory.

Changes
-------

[](#changes)

All changes are covered in the [changelog](changelog.md).

Contact
-------

[](#contact)

Get in touch personally using;

- The email address provided in the [composer.json](composer.json).
- [Discord chat](https://tenancy.dev/chat).
- [Twitter](http://twitter.com/laraveltenancy).

###  Health Score

32

↑

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 78% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Recently: every ~97 days

Total

129

Last Release

1831d ago

Major Versions

0.9.2 → 1.0.02015-12-08

1.x-dev → 2.0.0-beta.12016-07-12

2.x-dev → 5.0.0-beta.62017-07-26

3.x-dev → 5.0.0-beta.82017-09-06

0.5.7 → 5.0.82017-10-31

PHP version history (8 changes)0.1.0PHP &gt;=5.5.0

0.7.0PHP &gt;=5.5.9

2.0.0-beta.1PHP &gt;=7.0.0

5.0.0-beta.6PHP &gt;=7.1.0

5.0.0-beta.8PHP 7.\*

5.4.0-betaPHP &gt;= 7.2

5.5.0PHP ^7.2

5.7.0PHP ^7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/95a416b4cddeff42e31483ddf4c80e2c6c2f04fa56e12d6c4d13b2a5c95f604a?d=identicon)[achalj09](/maintainers/achalj09)

---

Top Contributors

[![luceos](https://avatars.githubusercontent.com/u/504687?v=4)](https://github.com/luceos "luceos (401 commits)")[![ArlonAntonius](https://avatars.githubusercontent.com/u/37894143?v=4)](https://github.com/ArlonAntonius "ArlonAntonius (28 commits)")[![bkintanar](https://avatars.githubusercontent.com/u/685928?v=4)](https://github.com/bkintanar "bkintanar (15 commits)")[![mikebronner](https://avatars.githubusercontent.com/u/1791050?v=4)](https://github.com/mikebronner "mikebronner (11 commits)")[![Thijmen](https://avatars.githubusercontent.com/u/383903?v=4)](https://github.com/Thijmen "Thijmen (8 commits)")[![fletch3555](https://avatars.githubusercontent.com/u/1387843?v=4)](https://github.com/fletch3555 "fletch3555 (8 commits)")[![stancl](https://avatars.githubusercontent.com/u/33033094?v=4)](https://github.com/stancl "stancl (5 commits)")[![bastien-phi](https://avatars.githubusercontent.com/u/10199039?v=4)](https://github.com/bastien-phi "bastien-phi (4 commits)")[![Plytas](https://avatars.githubusercontent.com/u/17316322?v=4)](https://github.com/Plytas "Plytas (3 commits)")[![JaZo](https://avatars.githubusercontent.com/u/3475007?v=4)](https://github.com/JaZo "JaZo (3 commits)")[![joshjacks](https://avatars.githubusercontent.com/u/13484664?v=4)](https://github.com/joshjacks "joshjacks (3 commits)")[![achalj09](https://avatars.githubusercontent.com/u/8180139?v=4)](https://github.com/achalj09 "achalj09 (2 commits)")[![drbyte](https://avatars.githubusercontent.com/u/404472?v=4)](https://github.com/drbyte "drbyte (2 commits)")[![janiskelemen](https://avatars.githubusercontent.com/u/20318292?v=4)](https://github.com/janiskelemen "janiskelemen (2 commits)")[![Sti3bas](https://avatars.githubusercontent.com/u/17280721?v=4)](https://github.com/Sti3bas "Sti3bas (2 commits)")[![TNovalis](https://avatars.githubusercontent.com/u/9816125?v=4)](https://github.com/TNovalis "TNovalis (2 commits)")[![vpratfr](https://avatars.githubusercontent.com/u/2526465?v=4)](https://github.com/vpratfr "vpratfr (2 commits)")[![mintunitish](https://avatars.githubusercontent.com/u/12434080?v=4)](https://github.com/mintunitish "mintunitish (1 commits)")[![mnapoli](https://avatars.githubusercontent.com/u/720328?v=4)](https://github.com/mnapoli "mnapoli (1 commits)")[![monkeywithacupcake](https://avatars.githubusercontent.com/u/7316730?v=4)](https://github.com/monkeywithacupcake "monkeywithacupcake (1 commits)")

---

Tags

laravelsaasmulti-tenanthynmulti-tenancytenancy

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/achalj09-multi-tenant/health.svg)

```
[![Health](https://phpackages.com/badges/achalj09-multi-tenant/health.svg)](https://phpackages.com/packages/achalj09-multi-tenant)
```

###  Alternatives

[hyn/multi-tenant

Run multiple websites using the same laravel installation while keeping tenant specific data separated for fully independant multi-domain setups.

2.6k1.1M9](/packages/hyn-multi-tenant)[stancl/tenancy

Automatic multi-tenancy for your Laravel application.

4.3k6.6M40](/packages/stancl-tenancy)[laravel/nightwatch

The official Laravel Nightwatch package.

3486.1M13](/packages/laravel-nightwatch)[tenancy/tenancy

Creating multi tenant saas from your Laravel app with ease

1.3k43.6k](/packages/tenancy-tenancy)[tenancy/framework

Creating multi tenant saas from your Laravel app with ease

13210.9k22](/packages/tenancy-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
