PHPackages                             tomatophp/filament-tenancy - 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. tomatophp/filament-tenancy

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

tomatophp/filament-tenancy
==========================

Tenancy multi-database integration for FilamentPHP

v1.0.8(1y ago)603.8k↓80.6%28[2 issues](https://github.com/tomatophp/filament-tenancy/issues)MITPHPPHP ^8.1|^8.2

Since Aug 21Pushed 1y ago8 watchersCompare

[ Source](https://github.com/tomatophp/filament-tenancy)[ Packagist](https://packagist.org/packages/tomatophp/filament-tenancy)[ GitHub Sponsors](https://github.com/3x1io)[ RSS](/packages/tomatophp-filament-tenancy/feed)WikiDiscussions master Synced 1mo ago

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

[![Screenshot](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/3x1io-tomato-tenancy.jpg)](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/3x1io-tomato-tenancy.jpg)

Filament Tenancy
================

[](#filament-tenancy)

[![Latest Stable Version](https://camo.githubusercontent.com/b7f4fe4cba549c7f60495de9f877497bdf69c312fe61a3c4832d41d1af69d5c2/68747470733a2f2f706f7365722e707567782e6f72672f746f6d61746f7068702f66696c616d656e742d74656e616e63792f76657273696f6e2e737667)](https://packagist.org/packages/tomatophp/filament-tenancy)[![License](https://camo.githubusercontent.com/a325660f8f1055fc3172a90c7ec2c129179fcbb4ec5238f6c3c562e5838f07a0/68747470733a2f2f706f7365722e707567782e6f72672f746f6d61746f7068702f66696c616d656e742d74656e616e63792f6c6963656e73652e737667)](https://packagist.org/packages/tomatophp/filament-tenancy)[![Downloads](https://camo.githubusercontent.com/00076f91092251d3468e109d97a04eca96ea63820803df2cbe08bd1f43326e0e/68747470733a2f2f706f7365722e707567782e6f72672f746f6d61746f7068702f66696c616d656e742d74656e616e63792f642f746f74616c2e737667)](https://packagist.org/packages/tomatophp/filament-tenancy)

Tenancy multi-database integration for FilamentPHP

Warning

We have a known problem with `route:cache` if you find a problem with multi-database connection from your tenant side you may face this problem just use `php artisan route:clear` and it will be fixed.

Screenshots
-----------

[](#screenshots)

[![Tenants](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/tenants.png)](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/tenants.png)[![Create](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/create.png)](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/create.png)[![Edit](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/edit.png)](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/edit.png)[![Password](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/password.png)](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/password.png)

Features
--------

[](#features)

- Multi Database
- Create Tenant Resource
- Sync Tenant Resource
- Password Change
- Tenant Impersonate
- Share Tenant Data
- Custom Theme For Tenant
- Livewire Component For Register New Tenant

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

[](#installation)

```
composer require tomatophp/filament-tenancy
```

after install your package please run this command

```
php artisan filament-tenancy:install
```

in your `.env` add this

```
CENTRAL_DOMAIN=tomatophp.test
```

where `tomatophp.test` is your central domain, and make sure you add a root user or a user have a permission to create database, then in your main central panel add this plugin

```
use TomatoPHP\FilamentTenancy\FilamentTenancyPlugin;

->plugin(FilamentTenancyPlugin::make()->panel('app'))
```

now you need to create a panel for tenancy app

```
php artisan filament:panel
```

and make the name same as `->panel('app')`, in your tenancy app panel add this plugin

```
use TomatoPHP\FilamentTenancy\FilamentTenancyAppPlugin;

->plugin(FilamentTenancyAppPlugin::make())
```

now on your `config\database.php` add this code

```
    ...
    'connections' => [
        'dynamic' => [
            'driver' => 'mysql',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
            'options' => extension_loaded('pdo_mysql') ? array_filter([
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
            ]) : [],
        ],
        ...
    ],
```

now run config:cache

```
php artisan config:cache
```

on your `bootstrap\app.php` add this middleware

```
use Stancl\Tenancy\Middleware\InitializeTenancyByDomain;
use Stancl\Tenancy\Middleware\InitializeTenancyBySubdomain;

->withMiddleware(function (Middleware $middleware) {
    $middleware->group('universal', [
        InitializeTenancyByDomain::class,
        InitializeTenancyBySubdomain::class,
    ]);
})
```

Allow Impersonate
-----------------

[](#allow-impersonate)

you can allow impersonate to tanent panel with 1 click by use this method on your plugin

```
use TomatoPHP\FilamentTenancy\FilamentTenancyPlugin;

->plugin(
    FilamentTenancyPlugin::make()
        ->panel('app')
        ->allowImpersonate()
)
```

Publish Assets
--------------

[](#publish-assets)

you can publish config file by use this command

```
php artisan vendor:publish --tag="filament-tenancy-config"
```

you can publish views file by use this command

```
php artisan vendor:publish --tag="filament-tenancy-views"
```

you can publish languages file by use this command

```
php artisan vendor:publish --tag="filament-tenancy-lang"
```

you can publish migrations file by use this command

```
php artisan vendor:publish --tag="filament-tenancy-migrations"
```

Other Filament Packages
-----------------------

[](#other-filament-packages)

Checkout our [Awesome TomatoPHP](https://github.com/tomatophp/awesome)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance47

Moderate activity, may be stable

Popularity38

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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 ~29 days

Recently: every ~52 days

Total

9

Last Release

391d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2147eb2fca7ab5f0124d0fafd88ba2d2a5dfa3a0036fb8872d1084b7cba29366?d=identicon)[fadymondy](/maintainers/fadymondy)

---

Top Contributors

[![fadymondy](https://avatars.githubusercontent.com/u/11937812?v=4)](https://github.com/fadymondy "fadymondy (18 commits)")[![adereksisusanto](https://avatars.githubusercontent.com/u/34746706?v=4)](https://github.com/adereksisusanto "adereksisusanto (3 commits)")[![AtefR](https://avatars.githubusercontent.com/u/43242743?v=4)](https://github.com/AtefR "AtefR (3 commits)")[![xx1196](https://avatars.githubusercontent.com/u/50302178?v=4)](https://github.com/xx1196 "xx1196 (3 commits)")[![livan2r](https://avatars.githubusercontent.com/u/1828332?v=4)](https://github.com/livan2r "livan2r (2 commits)")[![megoxv](https://avatars.githubusercontent.com/u/87904671?v=4)](https://github.com/megoxv "megoxv (1 commits)")

---

Tags

filament-pluginsmulti-database-multi-tenancytenancy-for-laraveltenancy-managementphplaravelmulti-tenancyfilamentphpmulti-databasetenancyfilament-pluginstomatophp

### Embed Badge

![Health badge](/badges/tomatophp-filament-tenancy/health.svg)

```
[![Health](https://phpackages.com/badges/tomatophp-filament-tenancy/health.svg)](https://phpackages.com/packages/tomatophp-filament-tenancy)
```

###  Alternatives

[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

15828.6k](/packages/relaticle-custom-fields)[tomatophp/filament-types

Manage any type on your app in Database with easy to use Resource for FilamentPHP

5616.7k8](/packages/tomatophp-filament-types)[tomatophp/filament-cms

Full CMS System with support of importing integrations and multi meta functions

11410.4k4](/packages/tomatophp-filament-cms)[tomatophp/filament-api

Generate APIs from your filament resource using single line of code

507.1k1](/packages/tomatophp-filament-api)[tomatophp/filament-translations

Manage your translation with DB and cache, you can scan your languages tags like trans(), \_\_(), and get the string inside and translate them use UI.

6230.1k3](/packages/tomatophp-filament-translations)[tomatophp/filament-users

Manage your users with a highly customizable user resource for FilamentPHP with integration of filament-shield and filament-impersonate

90102.0k7](/packages/tomatophp-filament-users)

PHPackages © 2026

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