1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-05-06 19:44:03 +00:00

Support channel overrides using dot notation

This commit is contained in:
lukinovec 2026-04-13 14:15:27 +02:00
parent 9660faf2f9
commit 221a9950c2
2 changed files with 7 additions and 5 deletions

View file

@ -9,6 +9,7 @@ use Illuminate\Contracts\Config\Repository as Config;
use Illuminate\Log\LogManager;
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
use Stancl\Tenancy\Contracts\Tenant;
use Illuminate\Support\Arr;
/**
* This bootstrapper makes it possible to configure tenant-specific logging.
@ -128,7 +129,7 @@ class LogTenancyBootstrapper implements TenancyBootstrapper
// If the tenant attribute is null,
// the override is ignored and the channel config key's value remains unchanged.
foreach ($override as $configKey => $tenantAttributeName) {
$tenantAttribute = $tenant->getAttribute($tenantAttributeName);
$tenantAttribute = Arr::get($tenant, $tenantAttributeName);
if ($tenantAttribute !== null) {
$this->config->set("logging.channels.{$channel}.{$configKey}", $tenantAttribute);