From 5fed08e8f0af8bfdf2a330f7b84a09f4fa4c3bd9 Mon Sep 17 00:00:00 2001 From: Alexis Gousseau Date: Tue, 16 Jan 2024 15:38:07 +0100 Subject: [PATCH] fix user:create command wording --- app/Console/Commands/UserCreate.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/Console/Commands/UserCreate.php b/app/Console/Commands/UserCreate.php index df4417b..2bf8d40 100644 --- a/app/Console/Commands/UserCreate.php +++ b/app/Console/Commands/UserCreate.php @@ -8,6 +8,7 @@ use Carbon\Carbon; use Illuminate\Console\Command; use Illuminate\Support\Facades\Validator; use Illuminate\Validation\ValidationException; +use Illuminate\Support\Str; class UserCreate extends Command { @@ -200,18 +201,22 @@ class UserCreate extends Command try { $tmp = $this->choice( 'Select his role', - [RoleEnum::conceptor->label(), RoleEnum::admin->label(), RoleEnum::visitor->label()], - RoleEnum::visitor->label(), + [ + Str::ucFirst(RoleEnum::conceptor->label()), + Str::ucFirst(RoleEnum::admin->label()), + Str::ucFirst(RoleEnum::visitor->label()) + ], + Str::ucFirst(RoleEnum::visitor->label()), $maxAttempts = null, $allowMultipleSelections = false ); - if ($tmp === RoleEnum::conceptor->label()) { + if ($tmp === Str::ucFirst(RoleEnum::conceptor->label())) { $tmp = RoleEnum::conceptor; } - if ($tmp === RoleEnum::admin->label()) { + if ($tmp === Str::ucFirst(RoleEnum::admin->label())) { $tmp = RoleEnum::admin; } - if ($tmp === RoleEnum::visitor->label()) { + if ($tmp === Str::ucFirst(RoleEnum::visitor->label())) { $tmp = RoleEnum::visitor; } $validator = Validator::make(['role' => $tmp], [