{"id":22238851,"url":"https://github.com/tomatophp/filament-tenancy","last_synced_at":"2025-04-05T18:05:51.096Z","repository":{"id":254099240,"uuid":"845468716","full_name":"tomatophp/filament-tenancy","owner":"tomatophp","description":"Tenancy multi-database integration for FilamentPHP","archived":false,"fork":false,"pushed_at":"2024-11-11T14:47:45.000Z","size":1530,"stargazers_count":48,"open_issues_count":12,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T17:03:12.608Z","etag":null,"topics":["filament-plugins","multi-database-multi-tenancy","tenancy-for-laravel","tenancy-management"],"latest_commit_sha":null,"homepage":"https://tomatophp.com/en/open-source/filament-tenancy","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomatophp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["3x1io"]}},"created_at":"2024-08-21T10:09:57.000Z","updated_at":"2025-03-07T17:26:04.000Z","dependencies_parsed_at":"2024-09-08T12:15:04.536Z","dependency_job_id":"92c93569-1f06-4e5e-829c-40b18faccc62","html_url":"https://github.com/tomatophp/filament-tenancy","commit_stats":null,"previous_names":["tomatophp/filament-tenancy"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomatophp%2Ffilament-tenancy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomatophp%2Ffilament-tenancy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomatophp%2Ffilament-tenancy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomatophp%2Ffilament-tenancy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomatophp","download_url":"https://codeload.github.com/tomatophp/filament-tenancy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378140,"owners_count":20929296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filament-plugins","multi-database-multi-tenancy","tenancy-for-laravel","tenancy-management"],"created_at":"2024-12-03T03:17:20.278Z","updated_at":"2025-04-05T18:05:51.057Z","avatar_url":"https://github.com/tomatophp.png","language":"PHP","funding_links":["https://github.com/sponsors/3x1io"],"categories":["Misc"],"sub_categories":[],"readme":"![Screenshot](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/3x1io-tomato-tenancy.jpg)\n\n# Filament Tenancy\n\n[![Latest Stable Version](https://poser.pugx.org/tomatophp/filament-tenancy/version.svg)](https://packagist.org/packages/tomatophp/filament-tenancy)\n[![License](https://poser.pugx.org/tomatophp/filament-tenancy/license.svg)](https://packagist.org/packages/tomatophp/filament-tenancy)\n[![Downloads](https://poser.pugx.org/tomatophp/filament-tenancy/d/total.svg)](https://packagist.org/packages/tomatophp/filament-tenancy)\n\nTenancy multi-database integration for FilamentPHP\n\n\u003e [!WARNING]  \n\u003e 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.\n\n## Screenshots\n\n![Tenants](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/tenants.png)\n![Create](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/create.png)\n![Edit](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/edit.png)\n![Password](https://raw.githubusercontent.com/tomatophp/filament-tenancy/master/arts/password.png)\n\n## Features\n\n- [x] Multi Database\n- [x] Create Tenant Resource\n- [x] Sync Tenant Resource\n- [x] Password Change\n- [x] Tenant Impersonate\n- [ ] Share Tenant Data\n- [ ] Custom Theme For Tenant\n- [ ] Livewire Component For Register New Tenant\n\n## Installation\n\n```bash\ncomposer require tomatophp/filament-tenancy\n```\nafter install your package please run this command\n\n```bash\nphp artisan filament-tenancy:install\n```\n\nin your `.env` add this\n\n```.env\nCENTRAL_DOMAIN=tomatophp.test\n```\n\nwhere `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\n\n```php\nuse TomatoPHP\\FilamentTenancy\\FilamentTenancyPlugin;\n\n-\u003eplugin(FilamentTenancyPlugin::make()-\u003epanel('app'))\n\n```\n\nnow you need to create a panel for tenancy app\n\n```bash\nphp artisan filament:panel\n```\n\nand make the name same as `-\u003epanel('app')`, in your tenancy app panel add this plugin\n\n```php\n\nuse TomatoPHP\\FilamentTenancy\\FilamentTenancyAppPlugin;\n\n-\u003eplugin(FilamentTenancyAppPlugin::make())\n```\n\nnow on your `config\\database.php` add this code\n\n```php\n    ...\n    'connections' =\u003e [\n        'dynamic' =\u003e [\n            'driver' =\u003e 'mysql',\n            'url' =\u003e env('DATABASE_URL'),\n            'host' =\u003e env('DB_HOST', '127.0.0.1'),\n            'port' =\u003e env('DB_PORT', '3306'),\n            'database' =\u003e env('DB_DATABASE', 'forge'),\n            'username' =\u003e env('DB_USERNAME', 'forge'),\n            'password' =\u003e env('DB_PASSWORD', ''),\n            'unix_socket' =\u003e env('DB_SOCKET', ''),\n            'charset' =\u003e 'utf8mb4',\n            'collation' =\u003e 'utf8mb4_unicode_ci',\n            'prefix' =\u003e '',\n            'prefix_indexes' =\u003e true,\n            'strict' =\u003e true,\n            'engine' =\u003e null,\n            'options' =\u003e extension_loaded('pdo_mysql') ? array_filter([\n                PDO::MYSQL_ATTR_SSL_CA =\u003e env('MYSQL_ATTR_SSL_CA'),\n            ]) : [],\n        ],\n        ...\n    ],  \n```\nnow run config:cache\n\n```php\nphp artisan config:cache\n```\n\non your `bootstrap\\app.php` add this middleware\n\n```php\nuse Stancl\\Tenancy\\Middleware\\InitializeTenancyByDomain;\nuse Stancl\\Tenancy\\Middleware\\InitializeTenancyBySubdomain;\n\n-\u003ewithMiddleware(function (Middleware $middleware) {\n    $middleware-\u003egroup('universal', [\n        InitializeTenancyByDomain::class,\n        InitializeTenancyBySubdomain::class,\n    ]);\n})\n```\n\n## Allow Impersonate\n\nyou can allow impersonate to tanent panel with 1 click by use this method on your plugin\n\n```php\n\nuse TomatoPHP\\FilamentTenancy\\FilamentTenancyPlugin;\n\n-\u003eplugin(\n    FilamentTenancyPlugin::make()\n        -\u003epanel('app')\n        -\u003eallowImpersonate()\n)\n```\n\n\n## Publish Assets\n\nyou can publish config file by use this command\n\n```bash\nphp artisan vendor:publish --tag=\"filament-tenancy-config\"\n```\n\nyou can publish views file by use this command\n\n```bash\nphp artisan vendor:publish --tag=\"filament-tenancy-views\"\n```\n\nyou can publish languages file by use this command\n\n```bash\nphp artisan vendor:publish --tag=\"filament-tenancy-lang\"\n```\n\nyou can publish migrations file by use this command\n\n```bash\nphp artisan vendor:publish --tag=\"filament-tenancy-migrations\"\n```\n\n## Other Filament Packages\n\nCheckout our [Awesome TomatoPHP](https://github.com/tomatophp/awesome)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomatophp%2Ffilament-tenancy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomatophp%2Ffilament-tenancy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomatophp%2Ffilament-tenancy/lists"}