option('email')); $name = $this->ask("Please provide a name"); $surname = $this->ask("Please provide a surname"); if (empty($email)) { $email = $this->ask("Please provide an email address"); } if (empty($password)) { // TODO: have a way to hide the input and do a confirm password input $password = $this->secret("Please provide a password"); } try { User::create([ 'name' => trim($name), 'surname' => trim($surname), 'email' => trim($email), 'password' => Hash::make(trim($password)), ]); $this->info("$email created successfully."); return Command::SUCCESS; } catch (\Exception $e) { $this->error('Unable to create your user.'); $this->line($e->getMessage()); return 1; } } }