From 812331d12ea58763ecbcd2c2b16ca998c2b1e66c Mon Sep 17 00:00:00 2001 From: Antonio Ribeiro Date: Wed, 14 Apr 2021 20:38:19 +0200 Subject: [PATCH] Allow passing email and password directly on the command line --- src/Commands/CreateSuperAdmin.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Commands/CreateSuperAdmin.php b/src/Commands/CreateSuperAdmin.php index 33a97211b..d81c4f79a 100644 --- a/src/Commands/CreateSuperAdmin.php +++ b/src/Commands/CreateSuperAdmin.php @@ -14,7 +14,7 @@ class CreateSuperAdmin extends Command * * @var string */ - protected $signature = 'twill:superadmin'; + protected $signature = 'twill:superadmin {email?} {password?}'; /** * The console command description. @@ -76,6 +76,9 @@ public function handle() */ private function setEmail() { + if (filled($email = $this->argument('email'))) { + return $email; + } $email = $this->ask('Enter an email'); if ($this->validateEmail($email)) { return $email; @@ -92,6 +95,9 @@ private function setEmail() */ private function setPassword() { + if (filled($email = $this->argument('password'))) { + return $email; + } $password = $this->secret('Enter a password'); if ($this->validatePassword($password)) { $confirmPassword = $this->secret('Confirm the password');