@if ($page->has_create == 1)
Add
@endif
@php
$input_name = optional($page->inputs->firstWhere('table_view', 1))->input_name;
@endphp
@php
function renderTreeChildren($children, $input_name, $page, $level = 1) {
foreach ($children as $key => $ch_item) {
$ch_data = json_decode($ch_item->data, true);
$hasGrandchildren = !empty($ch_item->children) && count($ch_item->children) > 0;
echo '';
echo ' ';
echo ($key + 1).'. '.($ch_data[$input_name] ?? '');
echo '';
if ($hasGrandchildren) {
echo '';
}
echo ' ';
}
}
@endphp
@foreach ($pageData as $item)
@php
$data = json_decode($item->data, true);
$hasChildren = !empty($item->children) && count($item->children) > 0;
@endphp
@endforeach