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) {