Add options field on setting data import

This commit is contained in:
Nabeel Shahzad 2018-02-19 11:19:18 -06:00
parent 1bb77e1d4b
commit 3d55fc09f7

View File

@ -82,18 +82,19 @@ class Migration extends MigrationBase
$group = $attrs['group'];
$order = $this->getNextOrderNumber($group);
$attrs = [
$attrs = array_merge([
'id' => Setting::formatKey($key),
'key' => $key,
'offset' => $this->offsets[$group],
'order' => $order,
'name' => $attrs['name'],
'name' => '',
'group' => $group,
'value' => $attrs['value'],
'default' => $attrs['value'],
'type' => $attrs['type'],
'description' => $attrs['description'],
];
'value' => '',
'default' => '',
'options' => '',
'type' => 'hidden',
'description' => '',
], $attrs);
return $this->addData('settings', [$attrs]);
}
@ -108,7 +109,7 @@ class Migration extends MigrationBase
{
$attrs['value'] = $value;
DB::table('settings')
->where('id', $this->formatSettingId($key))
->where('id', Setting::formatKey($key))
->update($attrs);
}