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

ActiveSymfony-bundle[Framework](/categories/framework)

syndicatetheory/multi-tenant-bundle
===================================

\[IN DEVELOPMENT\] Symfony2 Multi-Tenant Bundle

13402[1 issues](https://github.com/SyndicateTheory/SyndMultiTenantBundle/issues)PHP

Since Sep 15Pushed 13y ago4 watchersCompare

[ Source](https://github.com/SyndicateTheory/SyndMultiTenantBundle)[ Packagist](https://packagist.org/packages/syndicatetheory/multi-tenant-bundle)[ RSS](/packages/syndicatetheory-multi-tenant-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

SyndMultiTenantBundle
=====================

[](#syndmultitenantbundle)

SyndMultiTenantBundle adds multi-tenant support to your application. Set your entities to implement `MultiTenantInterface`, and you'll get the benefit of:

- Automatically assigned to the active Tenant
- Automatically filter repository calls by the active Tenant

### What is a Tenant?

[](#what-is-a-tenant)

A tenant is simply any class which represents an isolated set of data. It could be a Site (for example, you use `clientname.appname.com`, or it could be a company or user account that you need unique data for.

By having your tenant entity implement `TenantInterface`, you can leave the implementation details up to your application.

### Tenant Choosing Strategies

[](#tenant-choosing-strategies)

The bundle provides a default HostnameStrategy class, which attempts to pull the Tenant based on a Tenant.hostname field. More will be added later, or use your own by implementing `TenantStrategyInterface` - which simply returns a `TenantInterface`.

**Example candidates**:

- Site entity
- User entity
- Company entity

Working with multi-tenant capable Entities
------------------------------------------

[](#working-with-multi-tenant-capable-entities)

Your entity class needs to implement `MultiTenantInterface`, which defines `getTenant` and `setTenant` methods. After this, you can stop worrying about tenant-specific data.

It works by listening to new entities being persisted, and automatically calling setTenant with the active tenant.

There is also a new default EntityRepository class (`MultiTenantEntityRepository`), which is automatically instianated for mluti-tenant capable entities. It automatically filters all queries by the active Tenant.

If you have a custom repository class, be sure to extend this class instead of the default EntityRepository.

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

[](#installation)

Install via composer.json, and add the following config to your app/config.yml

```
synd_multi_tenant:
    domainstrategy:
        entity_class: Acme\YourBundle\Entity\User
        entity_field: domain

```

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/22b5e2bbe6620b5a7d97049df29cc6c4fa13d2ca7ec1a601ecbed6f3a13b2913?d=identicon)[hardchor](/maintainers/hardchor)

![](https://avatars.githubusercontent.com/u/117682?v=4)[Adrian Schneider](/maintainers/AdrianSchneider)[@AdrianSchneider](https://github.com/AdrianSchneider)

---

Top Contributors

[![AdrianSchneider](https://avatars.githubusercontent.com/u/117682?v=4)](https://github.com/AdrianSchneider "AdrianSchneider (27 commits)")

### Embed Badge

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

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

###  Alternatives

[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)

PHPackages © 2026

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