Skip to content

Commit

Permalink
Arrange ContributorCommand to get correct role value
Browse files Browse the repository at this point in the history
  • Loading branch information
sdkakcy committed Mar 9, 2024
1 parent 4f1f83a commit 67eff42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Console/Commands/ContributorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
$input->setArgument('role', select(
label: 'What role should the contributor have?',
options: [
RoleEnum::owner->value => RoleEnum::owner->label(),
RoleEnum::translator->value => RoleEnum::translator->label(),
RoleEnum::owner->label() => RoleEnum::owner->label(),
RoleEnum::translator->label() => RoleEnum::translator->label(),
],
default: 'Owner',
default: RoleEnum::owner->label(),
hint: 'The role may be changed at any time.'
));
}
Expand Down Expand Up @@ -86,7 +86,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
fn () => Contributor::create([
'name' => $name,
'email' => $email,
'role' => RoleEnum::fromLabel($role) ?? RoleEnum::owner->value,
'role' => RoleEnum::fromLabel($role),
'password' => Hash::make($password),
]),
'Creating contributor...'
Expand Down

0 comments on commit 67eff42

Please sign in to comment.