@php $dataTab = null; @endphp
@foreach ($fields as $key => $field)
@if (isset($field->tab))
@php $active = ($field->tab == 'details') ? ' active' : '';
$dataTab = $field->tab; @endphp
@endif
@if (isset($field->dataset))
@php $field->dataset->tab = $dataTab; @endphp
@else
@php $dataset = (object) ['tab' => $dataTab];
$field->dataset = $dataset; @endphp
@endif
@php $value = (isset($category) || str_starts_with($field->name, 'alias_extra_field_')) ? old($field->name, $field->value) : old($field->name); @endphp
@if ($field->name == 'image')
@php $path = (isset($category) && $category->image) ? url('/').$category->image->getThumbnailUrl() : asset('/images/camera.png'); @endphp
@endif
@if (!next($fields) || isset($fields[$key + 1]->tab))
@endif
@endforeach