Created
February 5, 2019 10:38
-
-
Save shamsher327/27d84b1b4ba2d1bfa6829adb51671341 to your computer and use it in GitHub Desktop.
User load and crate role
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$user = \Drupal\user\Entity\User::load(2131); | |
$user->addRole('administrator'); | |
$user->save(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment