PHPackages                             boruta/multi-tenancy-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. boruta/multi-tenancy-bundle

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

boruta/multi-tenancy-bundle
===========================

Flexible and production-ready multi-tenancy bundle for Symfony. Fork on: RamyHakam/multi\_tenancy\_bundle

v2.9.2(6mo ago)050MITPHPPHP ^8.1|^8.2|^8.3|^8.4

Since Apr 8Pushed 6mo agoCompare

[ Source](https://github.com/borutainfo/multi_tenancy_bundle)[ Packagist](https://packagist.org/packages/boruta/multi-tenancy-bundle)[ RSS](/packages/boruta-multi-tenancy-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (12)Versions (50)Used By (0)

Symfony Multi-Tenancy Bundle
============================

[](#symfony-multi-tenancy-bundle)

[![Multi-Tenancy Bundle (Desktop Wallpaper)](https://private-user-images.githubusercontent.com/17661342/237788633-eef23e6a-881c-4817-b7b8-8b7cec913154.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0MjMzMjgsIm5iZiI6MTc3NTQyMzAyOCwicGF0aCI6Ii8xNzY2MTM0Mi8yMzc3ODg2MzMtZWVmMjNlNmEtODgxYy00ODE3LWI3YjgtOGI3Y2VjOTEzMTU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA1VDIxMDM0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIxMTQ2YWJjZGJiMDllOGQ3MThjYTExMjMyMDY5MDAxMzM1MjZhYWI3ZDM2MDAzNDIxYzExMzAwZTI2MjkyZWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9I5RWmdbwFDgUApToqv5N_ZpDEJ37V7hDD1w7GT4ZT4)](https://private-user-images.githubusercontent.com/17661342/237788633-eef23e6a-881c-4817-b7b8-8b7cec913154.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0MjMzMjgsIm5iZiI6MTc3NTQyMzAyOCwicGF0aCI6Ii8xNzY2MTM0Mi8yMzc3ODg2MzMtZWVmMjNlNmEtODgxYy00ODE3LWI3YjgtOGI3Y2VjOTEzMTU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA1VDIxMDM0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIxMTQ2YWJjZGJiMDllOGQ3MThjYTExMjMyMDY5MDAxMzM1MjZhYWI3ZDM2MDAzNDIxYzExMzAwZTI2MjkyZWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9I5RWmdbwFDgUApToqv5N_ZpDEJ37V7hDD1w7GT4ZT4)

[![Action Status](https://github.com/RamyHakam/multi_tenancy_bundle/workflows/action_status/badge.svg?style=flat-square)](https://github.com/RamyHakam/multi_tenancy_bundle/workflows/action_status/badge.svg?style=flat-square)[![Total Downloads](https://camo.githubusercontent.com/b89d5175f6affb54943d428d982293e663b94614a31b4bee79a2749715d65dd4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68616b616d2f6d756c74692d74656e616e63792d62756e646c653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hakam/multi-tenancy-bundle)[![Symfony Flex](https://camo.githubusercontent.com/0836726b0ad4afccc66980ec7c563d79bb4f8d6c5db800cacadae3939f495a86/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e79253230466c65782d526563697065253230417661696c61626c652d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/symfony/recipes-contrib)

> 📚 **Full Documentation**: [Documentation](https://ramyhakam.github.io/multi_tenancy_bundle/intro/overview)

---

🧩 Overview
----------

[](#-overview)

The **Symfony Multi-Tenancy Bundle** enables scalable, production-ready multi-tenancy for Symfony applications.

Ideal for **SaaS platforms**, **region-based services**, and **multi-vendor e-commerce systems**, this bundle is built around a **database-per-tenant architecture**, giving each tenant:

- A fully isolated database
- Independent schema and migrations
- Configurable connection parameters (host, driver, credentials)

It integrates seamlessly with Doctrine and Symfony’s service container, offering:

- Automatic tenant database switching at runtime via `SwitchDbEvent`
- Separate migration and fixture paths for main vs. tenant databases
- Dedicated `TenantEntityManager` service for runtime isolation

For full usage examples and advanced configuration, see the [documentation](https://ramyhakam.github.io/multi_tenancy_bundle/).

---

🚀 Quick Installation
--------------------

[](#-quick-installation)

### 1. Via Symfony Flex (Recommended)

[](#1-via-symfony-flex-recommended)

```
composer require hakam/multi-tenancy-bundle
```

Symfony Flex will automatically scaffold config, register the bundle, and create:

```
src/Entity/Main/
src/Entity/Tenant/
migrations/Main/
migrations/Tenant/

```

### 2. Manual Installation

[](#2-manual-installation)

```
composer require hakam/multi-tenancy-bundle
```

Then register in `config/bundles.php`, copy the example `hakam_multi_tenancy.yaml` from docs, and create the required directories.

---

🔗 Useful Links
--------------

[](#-useful-links)

- **Full Documentation:** \[[https://ramyhakam.github.io/multi\_tenancy\_bundle/](https://ramyhakam.github.io/multi_tenancy_bundle/)\]
- **GitHub:** [https://github.com/RamyHakam/multi\_tenancy\_bundle](https://github.com/RamyHakam/multi_tenancy_bundle)
- **Packagist:**
- **Example Project:**

---

📄 License
---------

[](#-license)

MIT © Ramy Hakam

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance67

Regular maintenance activity

Popularity11

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 76.5% 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 ~66 days

Recently: every ~27 days

Total

26

Last Release

195d ago

Major Versions

v0.2 → v1.0.02022-05-28

v1.0.3 → v2.0.02023-04-24

v2.8.3 → v3.0.0-beta22025-07-13

PHP version history (8 changes)v0.2PHP ^7.2.5

v1.0.0PHP ^7.4

v1.0.1PHP ^7.4 | ^8.0

v1.0.2PHP ^7.4 | ^8.0 | ^8.1

v2.0.0PHP  ^8.0 | ^8.1

v2.5.1.x-devPHP ^8.1|^8.2

v2.6.0PHP ^8.1|^8.2|^8.3

v3.0.0-beta2PHP ^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/85cc760c4ab74fc51cc20ead906f7a85974ae51b59a0df460f8d3e7f56635f8f?d=identicon)[Boruta](/maintainers/Boruta)

---

Top Contributors

[![RamyHakam](https://avatars.githubusercontent.com/u/17661342?v=4)](https://github.com/RamyHakam "RamyHakam (140 commits)")[![mogilvie](https://avatars.githubusercontent.com/u/7894754?v=4)](https://github.com/mogilvie "mogilvie (29 commits)")[![Tbeaumont79](https://avatars.githubusercontent.com/u/32023386?v=4)](https://github.com/Tbeaumont79 "Tbeaumont79 (4 commits)")[![borutainfo](https://avatars.githubusercontent.com/u/16668386?v=4)](https://github.com/borutainfo "borutainfo (2 commits)")[![Galironfydar](https://avatars.githubusercontent.com/u/13006625?v=4)](https://github.com/Galironfydar "Galironfydar (2 commits)")[![skarnl](https://avatars.githubusercontent.com/u/3471506?v=4)](https://github.com/skarnl "skarnl (2 commits)")[![joosee7](https://avatars.githubusercontent.com/u/83545461?v=4)](https://github.com/joosee7 "joosee7 (1 commits)")[![robertfausk](https://avatars.githubusercontent.com/u/1651297?v=4)](https://github.com/robertfausk "robertfausk (1 commits)")[![JensMyParcel](https://avatars.githubusercontent.com/u/125662333?v=4)](https://github.com/JensMyParcel "JensMyParcel (1 commits)")[![NikoGrano](https://avatars.githubusercontent.com/u/4658966?v=4)](https://github.com/NikoGrano "NikoGrano (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/boruta-multi-tenancy-bundle/health.svg)

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

###  Alternatives

[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k235.4M9.7k](/packages/symfony-framework-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)

PHPackages © 2026

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