File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 2525namespace Pterodactyl \Console \Commands ;
2626
2727use Illuminate \Console \Command ;
28- use Pterodactyl \Repositories \oldUserRepository ;
28+ use Pterodactyl \Repositories \UserRepository ;
29+ use Pterodactyl \Services \Users \UserCreationService ;
2930
3031class 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 ) {
You can’t perform that action at this time.
0 commit comments