@php
$hasTabs = !empty($form['tabs']);
@endphp
@if ($form['columns'])
@if($hasTabs)
@php
$previousTab = null;
@endphp
@foreach ($form['columns'] as $column)
@if (!$column['hidden'])
@if($column['tab'] && $column['tab'] !== $previousTab)
@if($previousTab !== null)
@endif
@endif
@if($column['container_start::insert'])
@endif
@if($column['classes::insert'])
@endif
@include('data.form', compact('form', 'column'))
@if($column['classes::insert'])
@endif
@if($column['container_end::insert'])
@endif
@php
$previousTab = $column['tab'];
@endphp
@endif
@endforeach
@else
@foreach ($form['columns'] as $column)
@if (!$column['hidden'])
@if($column['container_start::insert'])
@endif
@if($column['classes::insert'])
@endif
@include('data.form', compact('form', 'column'))
@if($column['classes::insert'])
@endif
@if($column['container_end::insert'])
@endif
@endif
@endforeach
@endif
@endif
@if (session('current_tab_index'))
@endif
@if ($errors->any())
@endif