1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 20:14:03 +00:00

Improve checking if tenant attribute is set

This commit is contained in:
lukinovec 2025-07-31 16:52:06 +02:00
parent 42c837d967
commit 7bdbe9d880

View file

@ -112,9 +112,11 @@ class LogTenancyBootstrapper implements TenancyBootstrapper
// Map tenant properties to channel config keys.
// If the tenant property is not set (= is null),
// the override is ignored and the channel config key's value remains unchanged.
foreach ($override as $configKey => $tenantProperty) {
if ($tenant->$tenantProperty) {
$this->config->set("logging.channels.{$channel}.{$configKey}", $tenant->$tenantProperty);
foreach ($override as $configKey => $tenantAttributeName) {
$tenantAttribute = $tenant->getAttribute($tenantAttributeName);
if ($tenantAttribute !== null) {
$this->config->set("logging.channels.{$channel}.{$configKey}", $tenantAttribute);
}
}
} elseif ($override instanceof Closure) {