From 8f04342fc22cc9009521581aa2dbdc75c3296a34 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 16 Mar 2023 16:23:52 -0700 Subject: [PATCH] Added console command to normalize capitalization on names Signed-off-by: snipe --- app/Console/Commands/NormalizeUserNames.php | 52 +++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 app/Console/Commands/NormalizeUserNames.php diff --git a/app/Console/Commands/NormalizeUserNames.php b/app/Console/Commands/NormalizeUserNames.php new file mode 100644 index 000000000..c3ea5e8ac --- /dev/null +++ b/app/Console/Commands/NormalizeUserNames.php @@ -0,0 +1,52 @@ +info($users->count() . ' users'); + + foreach ($users as $user) { + $user->first_name = ucwords(strtolower($user->first_name)); + $user->last_name = ucwords(strtolower($user->last_name)); + $user->email = strtolower($user->email); + $user->save(); + } + } +}