Add options field on setting data import
This commit is contained in:
parent
1bb77e1d4b
commit
3d55fc09f7
@ -82,18 +82,19 @@ class Migration extends MigrationBase
|
|||||||
$group = $attrs['group'];
|
$group = $attrs['group'];
|
||||||
$order = $this->getNextOrderNumber($group);
|
$order = $this->getNextOrderNumber($group);
|
||||||
|
|
||||||
$attrs = [
|
$attrs = array_merge([
|
||||||
'id' => Setting::formatKey($key),
|
'id' => Setting::formatKey($key),
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
'offset' => $this->offsets[$group],
|
'offset' => $this->offsets[$group],
|
||||||
'order' => $order,
|
'order' => $order,
|
||||||
'name' => $attrs['name'],
|
'name' => '',
|
||||||
'group' => $group,
|
'group' => $group,
|
||||||
'value' => $attrs['value'],
|
'value' => '',
|
||||||
'default' => $attrs['value'],
|
'default' => '',
|
||||||
'type' => $attrs['type'],
|
'options' => '',
|
||||||
'description' => $attrs['description'],
|
'type' => 'hidden',
|
||||||
];
|
'description' => '',
|
||||||
|
], $attrs);
|
||||||
|
|
||||||
return $this->addData('settings', [$attrs]);
|
return $this->addData('settings', [$attrs]);
|
||||||
}
|
}
|
||||||
@ -108,7 +109,7 @@ class Migration extends MigrationBase
|
|||||||
{
|
{
|
||||||
$attrs['value'] = $value;
|
$attrs['value'] = $value;
|
||||||
DB::table('settings')
|
DB::table('settings')
|
||||||
->where('id', $this->formatSettingId($key))
|
->where('id', Setting::formatKey($key))
|
||||||
->update($attrs);
|
->update($attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user