@@ -22,7 +22,8 @@ class UserCreateCommand extends Command
2222 protected $ signature = 'admin:user:create
2323 { name : The name of the user }
2424 { email : The email of the user }
25- { --ask-for-password : Ask for the password, otherwise the command will generate a random one } ' ;
25+ { --ask-for-password : Ask for the password, otherwise the command will generate a random one }
26+ { --verify-email : Verify the email address of the user } ' ;
2627
2728 /**
2829 * The console command description.
@@ -39,6 +40,7 @@ public function handle(): int
3940 $ name = $ this ->argument ('name ' );
4041 $ email = $ this ->argument ('email ' );
4142 $ askForPassword = (bool ) $ this ->option ('ask-for-password ' );
43+ $ verifyEmail = (bool ) $ this ->option ('verify-email ' );
4244
4345 if (User::query ()->where ('email ' , $ email )->where ('is_placeholder ' , '= ' , false )->exists ()) {
4446 $ this ->error ('User with email " ' .$ email .'" already exists. ' );
@@ -71,6 +73,10 @@ public function handle(): int
7173 throw new LogicException ('User does not have an organization ' );
7274 }
7375
76+ if ($ verifyEmail ) {
77+ $ user ->markEmailAsVerified ();
78+ }
79+
7480 $ this ->info ('Created user " ' .$ name .'" (" ' .$ email .'") ' );
7581 $ this ->line ('ID: ' .$ user ->getKey ());
7682 $ this ->line ('Name: ' .$ name );
0 commit comments