When distributing console commands in a package or within an application, making sure data is in the correct format can be important. Run the following command in your terminal: This will create a new file in app/Console/Commands called MakeUserCommand.php with all of the normal command boilerplate.
If you wanted to validate this input, all you need to do is pass the data through to a new Validator and handle any errors.
If you went ahead and did this for the email too, you can be confident that the data being provided is valid.
If the validation fails and errors are shown to the user, instead of returning and exiting the process, we can instead return $this->askWithValidation so that the user is asked the same question again.