From 67eff4265df886d1378af1a0c1fea284c53c544c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C4=B1dd=C4=B1k=20Ak=C3=A7ay?= Date: Sat, 9 Mar 2024 09:15:37 +0300 Subject: [PATCH] Arrange `ContributorCommand` to get correct role value --- src/Console/Commands/ContributorCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Console/Commands/ContributorCommand.php b/src/Console/Commands/ContributorCommand.php index 940e0e4..8e4df69 100644 --- a/src/Console/Commands/ContributorCommand.php +++ b/src/Console/Commands/ContributorCommand.php @@ -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.' )); } @@ -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...'