@php
$dataTab = null;
$dateFormats = [];
@endphp
@foreach ($fields as $key => $field)
@if (isset($field->tab))
@php $active = ($field->tab == 'details') ? 'show 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($post) || str_starts_with($field->name, 'alias_extra_field_')) ? old($field->name, $field->value) : old($field->name); @endphp
@if ($field->name == 'image')
@php $path = (isset($post) && $post->image) ? url('/').$post->image->getThumbnailUrl() : asset('/images/camera.png'); @endphp
@endif
@if ($field->name == 'page')
@endif
@if ($field->type == 'date' && isset($field->dataset->format) && $field->name == 'updated_at')
@php $dateFormats[$field->name] = $field->dataset->format; @endphp
@endif
@if (!next($fields) || isset($fields[$key + 1]->tab))
@endif
@endforeach