namespace BookStack\Console\Commands;
+use BookStack\Auth\Role;
use BookStack\Auth\UserRepo;
use BookStack\Exceptions\NotFoundException;
use Illuminate\Console\Command;
return SymfonyCommand::FAILURE;
}
- $user = $this->userRepo->create($validator->validated());
- $this->userRepo->attachSystemRole($user, 'admin');
- $this->userRepo->downloadAndAssignUserAvatar($user);
+ $user = $this->userRepo->createWithoutActivity($validator->validated());
+ $user->attachRole(Role::getSystemRole('admin'));
$user->email_confirmed = true;
$user->save();
foreach ($this->options() as $key => $value) {
$returnOpts[str_replace('-', '_', $key)] = $value;
}
+
return $returnOpts;
}
}