PHPackages                             crsoares/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. crsoares/multi-tenant

ActiveLibrary[Framework](/categories/framework)

crsoares/multi-tenant
=====================

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

5.2.1(8y ago)06MITPHPPHP 7.\*

Since May 12Pushed 8y ago1 watchersCompare

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

READMEChangelogDependencies (8)Versions (102)Used By (0)

[![Backers on Open Collective](https://camo.githubusercontent.com/8dd31b2ae3c96e2c2139e0496ea7cdc0142b21e8744d1a39a5d00606be2d2d90/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f74656e616e63792f6261636b6572732f62616467652e737667)](#backers)[![Sponsors on Open Collective](https://camo.githubusercontent.com/96f1ede4a1c1cb880efa9a0ae3767d5dc74eb44d6504299e9239c5a8ab8401c6/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f74656e616e63792f73706f6e736f72732f62616467652e737667)](#sponsors)[![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://laravel-tenancy.com/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://laravel-tenancy.com) covers more than just the installation and configuration.

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

[](#requirements-recommended-environment)

- Latest stable and LTS Laravel versions.
- PHP 7+.
- Apache or Nginx.
- MySQL, MariaDB or PostgreSQL.

Please read the full [requirements in the documentation](https://laravel-tenancy.com/docs/hyn/5.x/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 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 tenancy:install
```

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)

---

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 note this will create an enormous number of tenant databases. You can easily remove these by running the bash script to clean the local databases that follow the same naming convention as this package:

```
bash tests/scripts/clean-local-dbs.sh
```

> Please be warned this 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://laravel-tenancy.com/chat).
- [Twitter](http://twitter.com/laraveltenancy).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 88% 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 ~11 days

Recently: every ~3 days

Total

95

Last Release

2936d 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 (5 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.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/14f6858667b504961a0b34d373a6eb4b4f2312bf89fb9ab5c983af6cb4f865fe?d=identicon)[crysthianophp](/maintainers/crysthianophp)

---

Top Contributors

[![luceos](https://avatars.githubusercontent.com/u/504687?v=4)](https://github.com/luceos "luceos (219 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 (4 commits)")[![joshjacks](https://avatars.githubusercontent.com/u/13484664?v=4)](https://github.com/joshjacks "joshjacks (3 commits)")[![crsoares](https://avatars.githubusercontent.com/u/3709264?v=4)](https://github.com/crsoares "crsoares (3 commits)")[![bkintanar](https://avatars.githubusercontent.com/u/685928?v=4)](https://github.com/bkintanar "bkintanar (2 commits)")[![TNovalis](https://avatars.githubusercontent.com/u/9816125?v=4)](https://github.com/TNovalis "TNovalis (2 commits)")[![PiranhaGeorge](https://avatars.githubusercontent.com/u/203654?v=4)](https://github.com/PiranhaGeorge "PiranhaGeorge (1 commits)")[![ianlchapman](https://avatars.githubusercontent.com/u/31708274?v=4)](https://github.com/ianlchapman "ianlchapman (1 commits)")[![AustinMaddox](https://avatars.githubusercontent.com/u/961446?v=4)](https://github.com/AustinMaddox "AustinMaddox (1 commits)")[![clarkwinkelmann](https://avatars.githubusercontent.com/u/5264300?v=4)](https://github.com/clarkwinkelmann "clarkwinkelmann (1 commits)")[![Dayvisson](https://avatars.githubusercontent.com/u/12189515?v=4)](https://github.com/Dayvisson "Dayvisson (1 commits)")[![almas-x](https://avatars.githubusercontent.com/u/9382335?v=4)](https://github.com/almas-x "almas-x (1 commits)")[![julianfox](https://avatars.githubusercontent.com/u/1648714?v=4)](https://github.com/julianfox "julianfox (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/crsoares-multi-tenant/health.svg)

```
[![Health](https://phpackages.com/badges/crsoares-multi-tenant/health.svg)](https://phpackages.com/packages/crsoares-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)
