@php function renderStructure($structure, $level = 0) { $paddingLeft = 20 * $level; $isArtigo = ($structure->structureType->abrev ?? '') === 'Art.'; $isCentered = $structure->structureType && $structure->structureType->center; $showAbrev = $structure->structureType && $structure->structureType->show_abrev; echo '
  • '; if ($isCentered) { echo '
    '; if ($showAbrev) { echo ''; echo $structure->structureType->abrev . ' ' . $structure->order_label; echo ''; } else { echo ''; echo $structure->order_label; echo ''; } if (!empty(trim($structure->content ?? ''))) { echo '
    '; echo $structure->content; echo '
    '; } echo '
    '; } else { echo '
    '; if ($showAbrev) { if ($isArtigo) { echo ''; echo $structure->structureType->abrev . ' ' . $structure->order_label; echo ''; } else { echo ''; echo $structure->structureType->abrev . ' ' . $structure->order_label . ' -'; echo ''; } } else { echo ''; echo $structure->order_label . ' -'; echo ''; } if (!empty(trim($structure->content ?? ''))) { echo ''; echo $structure->content; echo ''; } echo '
    '; } echo '
  • '; // Renderiza children recursivamente ORDENADOS if ($structure->children->count() > 0) { $sortedChildren = $structure->children->sortBy('sort_order'); echo ''; } } // Ordena as estruturas principais pelo sort_order $sortedStructures = $law->structures->sortBy('sort_order'); @endphp
    ๐Ÿ“‹ รndice da Lei
    @foreach ($sortedStructures as $index => $structure) @endforeach
    @include('maker.scripts.search') @include('maker.scripts.tabelas')