mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 20:34:03 +00:00
feat: add support for nested tenant config override
This commit is contained in:
parent
747c192979
commit
c3409e39e3
1 changed files with 2 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ namespace Stancl\Tenancy\Features;
|
||||||
|
|
||||||
use Illuminate\Contracts\Config\Repository;
|
use Illuminate\Contracts\Config\Repository;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
use Illuminate\Support\Facades\Event;
|
use Illuminate\Support\Facades\Event;
|
||||||
use Stancl\Tenancy\Contracts\Feature;
|
use Stancl\Tenancy\Contracts\Feature;
|
||||||
use Stancl\Tenancy\Contracts\Tenant;
|
use Stancl\Tenancy\Contracts\Tenant;
|
||||||
|
|
@ -45,7 +46,7 @@ class TenantConfig implements Feature
|
||||||
{
|
{
|
||||||
/** @var Tenant|Model $tenant */
|
/** @var Tenant|Model $tenant */
|
||||||
foreach (static::$storageToConfigMap as $storageKey => $configKey) {
|
foreach (static::$storageToConfigMap as $storageKey => $configKey) {
|
||||||
$override = $tenant->getAttribute($storageKey);
|
$override = Arr::get($tenant, $storageKey);
|
||||||
|
|
||||||
if (! is_null($override)) {
|
if (! is_null($override)) {
|
||||||
if (is_array($configKey)) {
|
if (is_array($configKey)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue