How to update role name progammatically in Drupal 8 I am new to Drupal 8. I want to save &amp; update role programmatically in database. I am using below code 

    //your data array
$data = array('id' =&gt; 'client', 'label' =&gt; 'Client');
//creating your role
$role = \Drupal\user\Entity\Role::create($data);
//saving your role
$role-&gt;save();


It works fine. Now I want update role name. How to proceed it? 

Please anyone suggest to me?
If you already have the role object loaded:

$role
  -&gt;set('label', 'New label')
  -&gt;save();


If you don't:

$role = \Drupal::entityTypeManager()
  -&gt;getStorage('user_role')
  -&gt;load('client')
  -&gt;set('label', 'New label')
  -&gt;save();