Hello,
In the project I'm currently working on, we adopted tenancy for Laravel in single database mode: tenants access to the same DB, resources, and assets.
We're relying on T4L mainly to load configurations specific for each tenant. These configurations are labels, blade templates, and not much else.
I followed this guide in order to have dynamic configurations, based on the detected tenant.
I'm wondering if it's possible to use the same concept for the central app.
Do you have something already available or this requires some custom development?
My idea is something like this:
- Add a new column in the
tenants table ((bool) is_tenant) to differentiate between tenant or central app records
- Modify T4L
TenantConfig feature (or add a new feature class), to read the config from the record with is_tenant == false, in case no tenant has been detected (basically tenant() == null.
- Raise an error whenever multiple records with
is_tenant === false are present, as this would make central app identification impossible.
What do you think about this? Do you see any problem in this logic or have any suggestion?
In case this is not available already, I can submit a PR once the feature is ready.
Let me know.
Hello,
In the project I'm currently working on, we adopted tenancy for Laravel in single database mode: tenants access to the same DB, resources, and assets.
We're relying on T4L mainly to load configurations specific for each tenant. These configurations are labels, blade templates, and not much else.
I followed this guide in order to have dynamic configurations, based on the detected tenant.
I'm wondering if it's possible to use the same concept for the central app.
Do you have something already available or this requires some custom development?
My idea is something like this:
tenantstable ((bool) is_tenant) to differentiate between tenant or central app recordsTenantConfigfeature (or add a new feature class), to read the config from the record withis_tenant == false, in case no tenant has been detected (basicallytenant() == null.is_tenant === falseare present, as this would make central app identification impossible.What do you think about this? Do you see any problem in this logic or have any suggestion?
In case this is not available already, I can submit a PR once the feature is ready.
Let me know.