Skip to content

Commit 73d153c

Browse files
committed
fix pterodactyl:user command
1 parent 7222754 commit 73d153c

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

app/Console/Commands/MakeUser.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
namespace Pterodactyl\Console\Commands;
2626

2727
use Illuminate\Console\Command;
28-
use Pterodactyl\Repositories\oldUserRepository;
28+
use Pterodactyl\Repositories\UserRepository;
29+
use Pterodactyl\Services\Users\UserCreationService;
2930

3031
class MakeUser extends Command
3132
{
@@ -49,12 +50,20 @@ class MakeUser extends Command
4950
*/
5051
protected $description = 'Create a user within the panel.';
5152

53+
/**
54+
* @var \Pterodactyl\Services\Users\UserCreationService
55+
*/
56+
protected $creationService;
57+
5258
/**
5359
* Create a new command instance.
5460
*/
55-
public function __construct()
61+
public function __construct(
62+
UserCreationService $creationService
63+
)
5664
{
5765
parent::__construct();
66+
$this->creationService = $creationService;
5867
}
5968

6069
/**
@@ -78,8 +87,8 @@ public function handle()
7887
$data['root_admin'] = is_null($this->option('admin')) ? $this->confirm('Is this user a root administrator?') : $this->option('admin');
7988

8089
try {
81-
$user = new oldUserRepository;
82-
$user->create($data);
90+
91+
$this->creationService->handle($data);
8392

8493
return $this->info('User successfully created.');
8594
} catch (\Exception $ex) {

0 commit comments

Comments
 (0)