Update the $setting in storage.

@param  \BBCMS\Http\Requests\Admin\SettingRequest  $request
@param  \BBCMS\Models\Setting  $setting
@return \Illuminate\Http\Response
497155
public function update(SettingRequest $request, Setting $setting)
    {
        $setting->update($request->all());
        
        return $this->makeRedirect(true, ['admin.settings.module', $setting->module], __('msg_update'));
    }
1321811
public function addSetting($setting)
    {
        $data = array(
            'setting_key' => $setting
        );
        
        if (in_array($setting, $this->getSerialized())) {
            $data['serialized'] = '1';
        }
        
        return $this->db->insert($this->getTable(), $data);
    }
1286736
public function add($setting, $data)
    {
        $this->config = \WebServCo\Framework\ArrayStorage::append(
            $this->config,
            [$setting => $data]
        );
        return true;
    }
894140
public function updateAction(Request $request)
    {
        $schemaAlias = $request->attributes->get('schema');

        $this->isGrantedOr403($schemaAlias);

        $settingsManager = $this->getSettingsManager();
        $settings = $settingsManager->load($schemaAlias);

        $isApiRequest = $this->isApiRequest($request);

        $form = $this
            ->getSettingsFormFactory()
            ->create($schemaAlias, $settings, $isApiRequest ? ['csrf_protection' => false] : [])
        ;

        if ($form->handleRequest($request)->isValid()) {
            $messageType = 'success';
            try {
                $settingsManager->save($settings);
                $message = $this->getTranslator()->trans('sylius.settings.update', [], 'flashes');
            } catch (ValidatorException $exception) {
                $message = $this->getTranslator()->trans($exception->getMessage(), [], 'validators');
                $messageType = 'error';
            }

            if ($isApiRequest) {
                return $this->handleView($this->view(null, Response::HTTP_NO_CONTENT));
            }

            $request->getSession()->getBag('flashes')->add($messageType, $message);

            if ($request->headers->has('referer')) {
                return $this->redirect($request->headers->get('referer'));
            }
        }

        return $this->render($request->attributes->get('template', 'SyliusSettingsBundle:Settings:update.html.twig'), [
            'settings' => $settings,
            'form' => $form->createView(),
        ]);
    }
75080
public function update(UpdateRequest $request)
    {
        $this->addDefaultGeoFields(\Request::input('template'));
        $this->useTemplate(\Request::input('template'));

        return parent::updateCrud();
    }
1154684
public function customSetting(string $settingKey, $settingValue): self
    {
        $this->clientConfig[$settingKey] = $settingValue;
        return $this;
    }
272756
public function setting($key)
    {
        return isset($this->settings[$key]) ? $this->settings[$key] : null;
    }
847489
public function update(array $settings)
    {
        foreach ($settings as $key => $value) {
            $this->getSettingOrFail($key);
        }

        $this->backend->setSettings($settings);
    }
237398
public function store(SettingRequest $request)
    {
        $setting = $this->model->create($request->all());
        
        return $this->makeRedirect(true, ['admin.settings.module', $setting->module], __('msg_store'));
    }
573209
public function set($setting, $value)
    {
        switch ($setting) {
            case 'optionsTemplate':
            case 'commandsTemplate':
            case 'usageTemplate':
                call_user_func([$this, 'set' . ucfirst($setting)], $value);
                break;
            default:
                $this->settings[$setting] = $value;
                break;
        }

        return $this;
    }
1007903
private function setSettings($settings)
    {
        if ($settings) {
            foreach ($this->settings as $key => &$value) {
                if (!empty($settings->{$key}) && $settings->{$key}) {
                    if (is_object($settings->{$key})) {
                        $value = array_merge(
                            $value,
                            json_decode(json_encode($settings->{$key}, JSON_FORCE_OBJECT), true)
                        );
                    } else {
                        $value = $settings->{$key};
                    }
                }
            }
        }
    }
155726
public function settingsAction(Request $request)
    {
        /** @var Theme $theme */
        $theme = $this->getDoctrine()
            ->getRepository('CampaignChainCoreBundle:Theme')
            ->find(1);

        $form = $this->createForm(ThemeType::class, $theme);

        $form->handleRequest($request);

        if ($form->isValid()) {
            /** @var FileUploadService $fileUploadService */
            $fileUploadService = $this->get('campaignchain.core.service.file_upload');

            $path = Theme::STORAGE_PATH.'/logo.png';
            /** @var UploadedFile $upload */
            $upload = $theme->getLogo();
            if($upload) {
                $uploadContent = file_get_contents($upload->getRealPath());
                $fileUploadService->deleteFile($path);
                $fileUploadService->storeImage($path, $uploadContent);
            }
            $theme->setLogo($path);

            $path = Theme::STORAGE_PATH.'/favicon.ico';
            /** @var UploadedFile $upload */
            $upload = $theme->getFavicon();
            if($upload) {
                $uploadContent = file_get_contents($upload->getRealPath());
                $fileUploadService->deleteFile($path);
                $fileUploadService->storeImage($path, $uploadContent);
            }
            $theme->setFavicon($path);

            $this->getDoctrine()->getManager()->flush();

            $this->addFlash(
                'success',
                'The theme settings were successfully changed!'
            );
        }

        return $this->render('CampaignChainCoreBundle:Base:new.html.twig', array(
            'form' => $form->createView(),
            'page_title' => 'Theme Settings',
        ));
    }
66436
public function setPreference(string $setting_name, string $setting_value): UserInterface
    {
        if ($this->user_id !== 0 && $this->getPreference($setting_name) !== $setting_value) {
            DB::table('user_setting')->updateOrInsert([
                'user_id'      => $this->user_id,
                'setting_name' => $setting_name,
            ], [
                'setting_value' => $setting_value,
            ]);

            $this->preferences[$setting_name] = $setting_value;
        }

        app('cache.array')->forget('user_setting' . $this->user_id);

        return $this;
    }
122971
public function settingsAction(Request $request)
    {
        $response = $this->getCacheTimeKeeper()->getResponse();
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        $entity = (new GeneralEntity())
            ->setTaskScheduler($this->container->getParameter('task_scheduler.enabled'))
            ->setDefaultSearch($this->container->getParameter('anime_db.catalog.default_search'))
            ->setLocale($request->getLocale());

        /* @var $chain ChainSearch */
        $chain = $this->get('anime_db.plugin.search_fill');
        /* @var $form Form */
        $form = $this->createForm(new GeneralForm($chain), $entity)
            ->handleRequest($request);

        if ($form->isValid()) {
            // update params
            $this->get('anime_db.manipulator.parameters')
                ->set('task_scheduler.enabled', $entity->getTaskScheduler());
            $this->get('anime_db.manipulator.parameters')
                ->set('anime_db.catalog.default_search', $entity->getDefaultSearch());
            $this->get('anime_db.manipulator.parameters')
                ->set('locale', $entity->getLocale());
            $this->get('anime_db.app.listener.request')->setLocale($request, $entity->getLocale());
            $this->get('anime_db.cache_clearer')->clear();

            return $this->redirect($this->generateUrl('home_settings'));
        }

        return $this->render('AnimeDbCatalogBundle:Home:settings.html.twig', [
            'form' => $form->createView(),
        ], $response);
    }
410357
public static function set(string $category, string $setting, $value)
    {
        if (!isset(self::$settings[$category])) {
            self::$settings[$category] = [];
        }

        self::$settings[$category][$setting] = $value;
    }
1371930
public function submitAction(Request $request)
    {
        try {
            $manager = $this->get('ongr_settings.settings_manager');
            $data = $request->get('setting');

            if (!empty($data['value']) && !is_string($data['value'])) {
                $data['value'] = json_encode($data['value']);
            }

            if ($request->get('force')) {
                $name = $request->get('name');
                $manager->update($name, $data);
            } else {
                $manager->create($data);
            }

            return new JsonResponse(['error' => false]);
        } catch (\Exception $e) {
            return new JsonResponse(
                [
                    'error' => true,
                    'message' => 'Error occurred! Something is wrong with provided data. '.
                        'Please try to submit form again.'
                ]
            );
        }
    }
987026
public function update(SettingsInterface $settings)
    {
        $request = $this->initApiRequest(
            $this->account->getApiToken(Token::API_SETTINGS),
            $this->account->getName(),
            $this->activeDomain
        );
        $request->setPath(ApiRequest::PATH_SETTINGS);
        $response = $request->put($settings);
        return self::checkResponse($request, $response);
    }