Skip to content

MakeUserCommand does not accept a name argument #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sconnole opened this issue Jan 23, 2025 · 2 comments
Closed

MakeUserCommand does not accept a name argument #217

sconnole opened this issue Jan 23, 2025 · 2 comments
Assignees

Comments

@sconnole
Copy link
Contributor

When trying to create a user with the --no-interaction flag the following error occurs

php artisan cachet:make:user [email protected] --password="password" --admin --no-interaction

   Laravel\Prompts\Exceptions\NonInteractiveValidationException

  Required.

  at vendor/laravel/prompts/src/Concerns/Interactivity.php:32
     28▕
     29▕         $this->validate($default);
     30▕
     31▕         if ($this->state === 'error') {
  ➜  32▕             throw new NonInteractiveValidationException($this->error);
     33▕         }
     34▕
     35▕         return $default;
     36▕     }

      +17 vendor frames

  18  artisan:13
      Illuminate\Foundation\Application::handleCommand(Object(Symfony\Component\Console\Input\ArgvInput))

There is currently no --name flag available

php artisan cachet:make:user [email protected] --password="password" --admin --name="test" --no-interaction


  The "--name" option does not exist.

This will provide the option to supply name as an argument

php artisan cachet:make:user --help
Description:
  Create a new user

Usage:
  cachet:make:user [options] [--] [<email>]

Arguments:
  email

Options:
      --password[=PASSWORD]  The user's password
      --admin                Whether the user is an admin
      --name[=NAME]          The name of the user
  -h, --help                 Display help for the given command. When no command is given display help for the list command
      --silent               Do not output any message
  -q, --quiet                Only errors are displayed. All other output is suppressed
  -V, --version              Display this application version
      --ansi|--no-ansi       Force (or disable --no-ansi) ANSI output
  -n, --no-interaction       Do not ask any interactive question
      --env[=ENV]            The environment the command should run under
  -v|vv|vvv, --verbose       Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
php artisan cachet:make:user [email protected] --password="password" --admin --name='test'  --no-interaction

   INFO  User created successfully.
@sconnole
Copy link
Contributor Author

I created a PR to fix this issue: #216

@sconnole
Copy link
Contributor Author

PR has been merged #216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant