@foreach ($fields as $key => $field)
@if (isset($field->tab))
@php $active = ($field->tab == 'details') ? 'show active' : '';
$dataTab = $field->tab; @endphp
@endif
@if (isset($field->tab) || (isset($field->extra) && in_array('new_row', $field->extra)))
@endif
@php $value = (isset($sharing)) ? old($field->name, $field->value) : old($field->name); @endphp
@if (isset($fields[$key + 1]->tab) || (isset($fields[$key + 1]->extra) && in_array('new_row', $fields[$key + 1]->extra)) || !isset($fields[$key + 1]))
@endif
@if (!next($fields) || isset($fields[$key + 1]->tab))
@endif
@endforeach