Download the PHP package syonix/multi-tenancy-bundle without Composer
On this page you can find all versions of the php package syonix/multi-tenancy-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download syonix/multi-tenancy-bundle
More information about syonix/multi-tenancy-bundle
Files in syonix/multi-tenancy-bundle
Package multi-tenancy-bundle
Short Description A multi tenancy bundle for symfony 2 apps
License MIT
Homepage https://github.com/tahoelimited/multi-tenancy-bundle
Informations about the package multi-tenancy-bundle
MultiTenancyBundle
Installation
Download MultiTenancyBundle using composer
Add MultiTenancy by running the command:
Composer will install the bundle to your project's vendor/tahoelimited
directory.
Enable the bundle
Enable the bundle in the kernel:
Configure the bundle
Add the following settings to your , you must preserve existing values, don't just overwrite an entire
parameters.yml
config.yml
If you use the tenant_aware
subdomain strategy, your tenant's will get access to the APP through a subdomain they choose.
If, in the contrary, you choose fixed
, all tenant will access through the same endpoint, and tenant will be stored agains
the logged in user (instead of being resolved by the subdomain).
Note: you can use your own form type along with the registration_subscriber
to get a more powerful behaviour.
routing.yml
Create your own tenant entity
You must create Tenant entity inside your bundle that extends one provided with the bundle. For example, something like this:
Update your existing user entity.
Note: MultiTenancyBundle requires FOSUSERBundle.
Making other entities tenant aware
All entities that are specific to the tenant should have the following applied. Any entities that are applicable to all tenants should be left alone.
Ensure / is free
/ is used for redirecting to tenants, so you cannot have any routes setup with just /
Using the bundle services
You can make use the services that this bundle provide to get the tenant that is connected.
When using the command line with this bundle, you may find that the tenantId
is not set. In order to avoid this error, you need to set the Tenant you want to work with manually, by calling the overrideTenant
from the TenantResolver
class.
All versions of multi-tenancy-bundle with dependencies
symfony/framework-bundle Version ~2.3
doctrine/orm Version ~2.2,>=2.2.3
doctrine/doctrine-bundle Version ~1.2
symfony/twig-bundle Version ~2.3
symfony/form Version ~2.3
symfony/security-bundle Version ~2.3
friendsofsymfony/user-bundle Version ~2.0
recurly/recurly-client Version 2.3.*