mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 17:44:04 +00:00
Don't hardcode data
This commit is contained in:
parent
7bc58f3980
commit
44b2846bcd
1 changed files with 2 additions and 2 deletions
|
|
@ -77,7 +77,7 @@ class TenantRepository extends Repository
|
|||
if (in_array($key, static::customColumns())) {
|
||||
$record->update([$key => $value]);
|
||||
} else {
|
||||
$data = json_decode($record->first(static::dataColumn())->data, true);
|
||||
$data = json_decode($record->first()->{static::dataColumn()}, true);
|
||||
$data[$key] = $value;
|
||||
|
||||
$record->update([static::dataColumn() => $data]);
|
||||
|
|
@ -89,7 +89,7 @@ class TenantRepository extends Repository
|
|||
$record = $this->where('id', $tenant->id);
|
||||
|
||||
$data = [];
|
||||
$jsonData = json_decode($record->first(static::dataColumn())->data, true);
|
||||
$jsonData = json_decode($record->first()->{static::dataColumn()}, true);
|
||||
foreach ($kvPairs as $key => $value) {
|
||||
if (in_array($key, static::customColumns())) {
|
||||
$data[$key] = $value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue