From 6d00b9b866a8335f78845b67091df910afb14481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Fri, 4 Oct 2019 22:32:43 +0200 Subject: [PATCH] Use $data instead of get() in TenantConfig --- assets/config.php | 2 +- src/Features/TenantConfig.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/assets/config.php b/assets/config.php index bc954c89..9b848b5f 100644 --- a/assets/config.php +++ b/assets/config.php @@ -82,9 +82,9 @@ return [ // not needed for tenancy to be bootstrapped. They are run // regardless of whether tenancy has been initialized. + // Stancl\Tenancy\Features\TenantConfig::class, // Stancl\Tenancy\Features\TelescopeTags::class, // Stancl\Tenancy\Features\TenantRedirect::class, - // Stancl\Tenancy\Features\TenantConfig::class, ], 'storage_to_config_map' => [ // Used by the TenantConfig feature // 'paypal_api_key' => 'services.paypal.api_key', diff --git a/src/Features/TenantConfig.php b/src/Features/TenantConfig.php index 88e85a90..25c8a57d 100644 --- a/src/Features/TenantConfig.php +++ b/src/Features/TenantConfig.php @@ -40,7 +40,10 @@ class TenantConfig implements Feature public function setTenantConfig(Tenant $tenant): void { foreach ($this->getStorageToConfigMap() as $storageKey => $configKey) { - $this->config[$configKey] = $tenant->get($storageKey); + $override = $tenant->data[$storageKey] ?? null; + if (! is_null($override)) { + $this->config[$configKey] = $override; + } } }