/** * @param $selection * @param ThemeSettingDefault $default * @param $account * @param ThemeSetting $setting */ protected function setupJsonDefault($selection, ThemeSettingDefault $default, $account, ThemeSetting $setting) { $json = json_decode($default->value); $type = $setting->type->name; $setting->value()->create(['account_id' => $account, 'selection_id' => $selection, 'nl' => [$type => $json->nl], 'en' => [$type => $json->en]]); }
/** * @param ThemeSetting $setting */ protected function settingJsonHandle(ThemeSetting $setting) { if (isset($this->defaults[$setting->key])) { $setting->defaults()->create(['value' => json_encode($this->defaults[$setting->key])]); } }
public function down() { ThemeSetting::whereIn('key', $this->settingKeys())->delete(); }