1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 15:54:03 +00:00

Use $data instead of get() in TenantConfig

This commit is contained in:
Samuel Štancl 2019-10-04 22:32:43 +02:00
parent 24ce8f9454
commit 6d00b9b866
2 changed files with 5 additions and 2 deletions

View file

@ -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',

View file

@ -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;
}
}
}