]> BookStack Code Mirror - bookstack/blobdiff - app/Console/Commands/CreateAdmin.php
Fix Crowdin name in the language_request issue template
[bookstack] / app / Console / Commands / CreateAdmin.php
index c571d383ea92f1866e4632283718f3b3071a15e3..e4660314d6e4365676a23049d7b825fa32a95f5b 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace BookStack\Console\Commands;
 
+use BookStack\Auth\Role;
 use BookStack\Auth\UserRepo;
 use BookStack\Exceptions\NotFoundException;
 use Illuminate\Console\Command;
@@ -85,7 +86,7 @@ class CreateAdmin extends Command
         }
 
         $user = $this->userRepo->createWithoutActivity($validator->validated());
-        $this->userRepo->attachSystemRole($user, 'admin');
+        $user->attachRole(Role::getSystemRole('admin'));
         $user->email_confirmed = true;
         $user->save();