You are here

public function TawktoGenerator::removeWidget in tawk.to Live Chat (Drupal 8) 8

File

tawk_to/src/core/TawktoGenerator.php, line 368

Class

TawktoGenerator

Namespace

Drupal\tawk_to\core

Code

public function removeWidget() {
  $config = \Drupal::service('config.factory')
    ->getEditable('tawk_to.settings');
  $config
    ->set('tawk_to.page_id', 0);
  $config
    ->set('tawk_to.widget_id', 0);
  $config
    ->set('tawk_to.user_id', 0);

  // $config->set('tawk_to.options', 0);
  $config
    ->save();
  $options = array(
    'success' => true,
  );
  return new JsonResponse($options);
}