// Hash plaintext passwords $users = DB::table('wrr_users')->select('Id', 'password')->get(); $hashed = 0; foreach ($users as $user) { if (str_starts_with($user->password, '$2y$') || str_starts_with($user->password, '$2a$')) { continue; } DB::table('wrr_users') ->where('Id', $user->Id) ->update(['password' => Hash::make($user->password)]); $hashed++; } echo "Hashed {$hashed} plaintext passwords.\n";