From 11b1e6a1983c8833a0e21acdec3cd30c012a6a3a Mon Sep 17 00:00:00 2001 From: philipp lang Date: Fri, 23 Aug 2024 22:25:25 +0200 Subject: [PATCH] Lint migrations --- database/migrations/2024_07_31_215841_update_users_names.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2024_07_31_215841_update_users_names.php b/database/migrations/2024_07_31_215841_update_users_names.php index 7fb166ab..5851ad63 100644 --- a/database/migrations/2024_07_31_215841_update_users_names.php +++ b/database/migrations/2024_07_31_215841_update_users_names.php @@ -25,7 +25,7 @@ return new class extends Migration foreach (DB::table('users')->get() as $user) { [$firstname, $lastname] = explode(' ', $user->name); - DB::table('users')->where('id', $user->id)->update(['firstname' => $firstname ?? '', 'lastname' => $lastname ?? '']); + DB::table('users')->where('id', $user->id)->update(['firstname' => $firstname ?: '', 'lastname' => $lastname ?: '']); } Schema::table('users', function (Blueprint $table) {