mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 02:54:05 +00:00
Improve checking if tenant attribute is set
This commit is contained in:
parent
42c837d967
commit
7bdbe9d880
1 changed files with 5 additions and 3 deletions
|
|
@ -112,9 +112,11 @@ class LogTenancyBootstrapper implements TenancyBootstrapper
|
||||||
// Map tenant properties to channel config keys.
|
// Map tenant properties to channel config keys.
|
||||||
// If the tenant property is not set (= is null),
|
// If the tenant property is not set (= is null),
|
||||||
// the override is ignored and the channel config key's value remains unchanged.
|
// the override is ignored and the channel config key's value remains unchanged.
|
||||||
foreach ($override as $configKey => $tenantProperty) {
|
foreach ($override as $configKey => $tenantAttributeName) {
|
||||||
if ($tenant->$tenantProperty) {
|
$tenantAttribute = $tenant->getAttribute($tenantAttributeName);
|
||||||
$this->config->set("logging.channels.{$channel}.{$configKey}", $tenant->$tenantProperty);
|
|
||||||
|
if ($tenantAttribute !== null) {
|
||||||
|
$this->config->set("logging.channels.{$channel}.{$configKey}", $tenantAttribute);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($override instanceof Closure) {
|
} elseif ($override instanceof Closure) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue