Fix: update single name in migrations
continuous-integration/drone/push Build is failing Details

This commit is contained in:
philipp lang 2024-08-02 12:05:21 +02:00
parent d9adb526ce
commit 8b3b3de9a8
1 changed files with 1 additions and 1 deletions

View File

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