mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 21:34:04 +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.
|
||||
// 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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue