@@ -35,6 +35,9 @@ class MakeUser extends Command
3535 * @var string
3636 */
3737 protected $ signature = 'pterodactyl:user
38+ {--firstname= : First name to use for this account.}
39+ {--lastname= : Last name to use for this account.}
40+ {--username= : Username to use for this account.}
3841 {--email= : Email address to use for this account.}
3942 {--password= : Password to assign to the user.}
4043 {--admin= : Boolean flag for if user should be an admin.} ' ;
@@ -63,19 +66,22 @@ public function __construct()
6366 */
6467 public function handle ()
6568 {
66- $ email = is_null ($ this ->option ('email ' )) ? $ this ->ask ('Email ' ) : $ this ->option ('email ' );
67- $ password = is_null ($ this ->option ('password ' )) ? $ this ->secret ('Password ' ) : $ this ->option ('password ' );
69+ $ data ['name_first ' ] = is_null ($ this ->option ('firstname ' )) ? $ this ->ask ('First Name ' ) : $ this ->option ('firstname ' );
70+ $ data ['name_last ' ] = is_null ($ this ->option ('lastname ' )) ? $ this ->ask ('Last Name ' ) : $ this ->option ('lastname ' );
71+ $ data ['username ' ] = is_null ($ this ->option ('username ' )) ? $ this ->ask ('Username ' ) : $ this ->option ('username ' );
72+ $ data ['email ' ] = is_null ($ this ->option ('email ' )) ? $ this ->ask ('Email ' ) : $ this ->option ('email ' );
73+ $ data ['password ' ] = is_null ($ this ->option ('password ' )) ? $ this ->secret ('Password ' ) : $ this ->option ('password ' );
6874 $ password_confirmation = is_null ($ this ->option ('password ' )) ? $ this ->secret ('Confirm Password ' ) : $ this ->option ('password ' );
6975
70- if ($ password !== $ password_confirmation ) {
76+ if ($ data [ ' password ' ] !== $ password_confirmation ) {
7177 return $ this ->error ('The passwords provided did not match! ' );
7278 }
7379
74- $ admin = is_null ($ this ->option ('admin ' )) ? $ this ->confirm ('Is this user a root administrator? ' ) : $ this ->option ('admin ' );
80+ $ data [ ' root_admin ' ] = is_null ($ this ->option ('admin ' )) ? $ this ->confirm ('Is this user a root administrator? ' ) : $ this ->option ('admin ' );
7581
7682 try {
7783 $ user = new UserRepository ;
78- $ user ->create ($ email , $ password , $ admin );
84+ $ user ->create ($ data );
7985
8086 return $ this ->info ('User successfully created. ' );
8187 } catch (\Exception $ ex ) {
0 commit comments