Execute this code Anyhow on the server to uninstall module
// Read the configuration.
$module_data = \Drupal::config('core.extension')->get('module');
// Unset the modules you do not need.
unset($module_data['MODULE_NAME']);
// Write the configuration.
\Drupal::configFactory()->getEditable('core.extension')->set('module', $module_data)->save();
Another Way:
<?php
\Drupal::service('module_installer')->install(['admin_toolbar']);
?>
<?php
\Drupal::service('module_installer')->uninstall(['admin_toolbar']);
?>
Delete config:
\Drupal::configFactory()->getEditable('contact.form.personal')->delete();
Comments
Post a Comment