Config

Edit Drupal 8 config programmatically

Edit Drupal 8 config programmatically
$config_factory = \Drupal::configFactory();
$langcode = $config_factory->get('system.site')->get('langcode');
$config_factory->getEditable('system.site')->set('default_langcode', $langcode)->save();