PHPackages                             orchestra/tenanti - 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. [Database &amp; ORM](/categories/database)
4. /
5. orchestra/tenanti

ActiveLibrary[Database &amp; ORM](/categories/database)

orchestra/tenanti
=================

Tenant based Database Schema Manager for Laravel

v6.3.0(4y ago)588123.8k↓35.7%54[2 PRs](https://github.com/orchestral/tenanti/pulls)MITPHPPHP ^7.3 || ^8.0

Since Jul 12Pushed 2y ago25 watchersCompare

[ Source](https://github.com/orchestral/tenanti)[ Packagist](https://packagist.org/packages/orchestra/tenanti)[ Fund](https://paypal.me/crynobone)[ Fund](https://liberapay.com/crynobone)[ RSS](/packages/orchestra-tenanti/feed)WikiDiscussions 6.x Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (85)Used By (0)

Multi-tenant Database Schema Manager for Laravel
================================================

[](#multi-tenant-database-schema-manager-for-laravel)

Tenanti allow you to manage multi-tenant data schema and migration manager for your Laravel application.

[![tests](https://github.com/orchestral/tenanti/workflows/tests/badge.svg?branch=6.x)](https://github.com/orchestral/tenanti/actions?query=workflow%3Atests+branch%3A6.x)[![Latest Stable Version](https://camo.githubusercontent.com/38d2027dc2fad07578e55a9a43e61ec997dbb9690395a287c5cba76e8b24491b/68747470733a2f2f706f7365722e707567782e6f72672f6f72636865737472612f74656e616e74692f762f737461626c65)](https://packagist.org/packages/orchestra/tenanti)[![Total Downloads](https://camo.githubusercontent.com/0ae9dbd5938c88a5646dd03f700e733cb03f88718e03d6841a69ff29e92cb9ff/68747470733a2f2f706f7365722e707567782e6f72672f6f72636865737472612f74656e616e74692f646f776e6c6f616473)](https://packagist.org/packages/orchestra/tenanti)[![Latest Unstable Version](https://camo.githubusercontent.com/5d7c7db7def9e8fa1f9d45ef787b6175ba5bd7b40eb187bdc3535d7bf6f78e92/68747470733a2f2f706f7365722e707567782e6f72672f6f72636865737472612f74656e616e74692f762f756e737461626c65)](https://packagist.org/packages/orchestra/tenanti)[![License](https://camo.githubusercontent.com/c425b60a7ec3fe49e0d24b5595c42490dc3abb6a7f91f0b70584e6f1ee7fed39/68747470733a2f2f706f7365722e707567782e6f72672f6f72636865737472612f74656e616e74692f6c6963656e7365)](https://packagist.org/packages/orchestra/tenanti)[![Coverage Status](https://camo.githubusercontent.com/8ecdf536df7a94eeaf286f25752fea1bf6ea0e46a948d301f6eeed332d484316/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6f72636865737472616c2f74656e616e74692f62616467652e7376673f6272616e63683d362e78)](https://coveralls.io/github/orchestral/tenanti?branch=6.x)

Version Compatibility
---------------------

[](#version-compatibility)

LaravelTenanti5.5.x3.5.x5.6.x3.6.x5.7.x3.7.x5.8.x3.8.x6.x4.x7.x5.x8.x6.xInstallation
------------

[](#installation)

To install through composer, run the following command from terminal:

```
composer require "orchestra/tenanti"
```

Configuration
-------------

[](#configuration)

Next add the following service provider in `config/app.php`.

```
'providers' => [

    // ...
    Orchestra\Tenanti\TenantiServiceProvider::class,
    Orchestra\Tenanti\CommandServiceProvider::class,
],
```

> The command utility is enabled via `Orchestra\Tenanti\CommandServiceProvider`.

### Aliases

[](#aliases)

To make development easier, you could add `Orchestra\Support\Facades\Tenanti` alias for easier reference:

```
'aliases' => [

    'Tenanti' => Orchestra\Support\Facades\Tenanti::class,

],
```

### Publish Configuration

[](#publish-configuration)

To make it easier to configuration your tenant setup, publish the configuration:

```
php artisan vendor:publish
```

Usage
-----

[](#usage)

### Configuration Tenant Driver for Single Database

[](#configuration-tenant-driver-for-single-database)

Open `config/orchestra/tenanti.php` and customize the drivers.

```
