Plugin – Combine Meta Box Input Fields into single saveble record

Use something like this after you foreach loop. In this example link is saved in new meta field. You can overwrite document_overview_document-link, but then you will get combined html code as link value when open your document in editor.

foreach {
    ...
}

if ( isset( $_POST[ 'document-link' ] ) ) {
    $html="<a class="btn btn-outline-info btn-block" href="" . esc_url( $_POST[ 'document-link' ] ) .  '" aria-label="Download File"><i class="fa ' . sanitize_text_field( $_POST[ 'document-mime-type' ] ) .  '" aria-hidden="true"></i></a>';
} else {
    $html="";        
}

update_post_meta( $post_id, 'document_overview_link_html', $html );