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