Skip to content

Replicate TenantConfig for Central App ? #1399

Description

@trane77

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:

  1. Add a new column in the tenants table ((bool) is_tenant) to differentiate between tenant or central app records
  2. 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.
  3. 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.

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions