diff --git a/app/Console/Commands/MakeUser.php b/app/Console/Commands/MakeUser.php index a4c0d442a..b7c7c78d7 100644 --- a/app/Console/Commands/MakeUser.php +++ b/app/Console/Commands/MakeUser.php @@ -25,7 +25,8 @@ namespace Pterodactyl\Console\Commands; use Illuminate\Console\Command; -use Pterodactyl\Repositories\oldUserRepository; +use Pterodactyl\Repositories\UserRepository; +use Pterodactyl\Services\Users\UserCreationService; class MakeUser extends Command { @@ -49,12 +50,20 @@ class MakeUser extends Command */ protected $description = 'Create a user within the panel.'; + /** + * @var \Pterodactyl\Services\Users\UserCreationService + */ + protected $creationService; + /** * Create a new command instance. */ - public function __construct() + public function __construct( + UserCreationService $creationService + ) { parent::__construct(); + $this->creationService = $creationService; } /** @@ -78,8 +87,8 @@ class MakeUser extends Command $data['root_admin'] = is_null($this->option('admin')) ? $this->confirm('Is this user a root administrator?') : $this->option('admin'); try { - $user = new oldUserRepository; - $user->create($data); + + $this->creationService->handle($data); return $this->info('User successfully created.'); } catch (\Exception $ex) {