mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 04:54:04 +00:00
Use data_get() instead of getAttribute() in overrideChannelConfig
The bootstrapper should be able to map nested tenant attributes to config, and `getAttribute()` doesn't support dot notation, so e.g. `$tenant->getAttribute('logging.slackUrl')` would return `null` instead of the actual attribute, so the test failed.
`data_get()` supports dot notation, so we'll use that.
This commit is contained in:
parent
8107ed4ecc
commit
dc331bfd9b
1 changed files with 1 additions and 1 deletions
|
|
@ -171,7 +171,7 @@ class LogTenancyBootstrapper implements TenancyBootstrapper
|
|||
// the override is ignored and the channel config key's value remains unchanged.
|
||||
foreach ($override as $configKey => $tenantAttributeName) {
|
||||
/** @var Tenant&Model $tenant */
|
||||
$tenantAttribute = $tenant->getAttribute($tenantAttributeName);
|
||||
$tenantAttribute = data_get($tenant, $tenantAttributeName);
|
||||
|
||||
if ($tenantAttribute !== null) {
|
||||
$this->config->set("logging.channels.{$channel}.{$configKey}", $tenantAttribute);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue