You are here

public function LivechatController::resetProps in LiveChat 8.3

Method resetProps().

1 string reference to 'LivechatController::resetProps'
livechat.routing.yml in ./livechat.routing.yml
livechat.routing.yml

File

src/Controller/LivechatController.php, line 119

Class

LivechatController
LivechatController class.

Namespace

Drupal\livechat\Controller

Code

public function resetProps(Request $request) {
  $settings = $this->configFactory
    ->getEditable('livechat.settings');
  $settings
    ->set('licence_number', '0')
    ->save();
  $settings
    ->set('livechat_login', '0')
    ->save();
  $settings
    ->set('livechat_mobile', '0')
    ->save();
  drupal_flush_all_caches();
  return new JsonResponse([
    'settings_reset' => 'success',
  ]);
}