public static function updateNames($xref, $ged_id, GedcomRecord $record): void
    {
        foreach ($record->getAllNames() as $n => $name) {
            if ($record instanceof Individual) {
                if ($name['givn'] === '@P.N.') {
                    $soundex_givn_std = null;
                    $soundex_givn_dm  = null;
                } else {
                    $soundex_givn_std = Soundex::russell($name['givn']);
                    $soundex_givn_dm  = Soundex::daitchMokotoff($name['givn']);
                }
                if ($name['surn'] === '@N.N.') {
                    $soundex_surn_std = null;
                    $soundex_surn_dm  = null;
                } else {
                    $soundex_surn_std = Soundex::russell($name['surname']);
                    $soundex_surn_dm  = Soundex::daitchMokotoff($name['surname']);
                }
                DB::table('name')->insert([
                    'n_file'             => $ged_id,
                    'n_id'               => $xref,
                    'n_num'              => $n,
                    'n_type'             => $name['type'],
                    'n_sort'             => mb_substr($name['sort'], 0, 255),
                    'n_full'             => mb_substr($name['fullNN'], 0, 255),
                    'n_surname'          => mb_substr($name['surname'], 0, 255),
                    'n_surn'             => mb_substr($name['surn'], 0, 255),
                    'n_givn'             => mb_substr($name['givn'], 0, 255),
                    'n_soundex_givn_std' => $soundex_givn_std,
                    'n_soundex_surn_std' => $soundex_surn_std,
                    'n_soundex_givn_dm'  => $soundex_givn_dm,
                    'n_soundex_surn_dm'  => $soundex_surn_dm,
                ]);
            } else {
                DB::table('name')->insert([
                    'n_file' => $ged_id,
                    'n_id'   => $xref,
                    'n_num'  => $n,
                    'n_type' => $name['type'],
                    'n_sort' => mb_substr($name['sort'], 0, 255),
                    'n_full' => mb_substr($name['fullNN'], 0, 255),
                ]);
            }
        }
    }