@php $sectionsArray = []; if (!empty($sections)) { if (is_string($sections)) { $sectionsArray = json_decode($sections, true) ?: []; } elseif (is_array($sections)) { $sectionsArray = $sections; } } // Processa a injeção de imagens e dados dinâmicos das seções de forma agnóstica $renderer = app(\V2\Services\LandingSectionsEditor\Services\LandingSectionsEditorRendererService::class); $sectionsArray = $renderer->prepareSections($sectionsArray); @endphp @push('head-styles') @endpush @if(!empty($sectionsArray) && is_array($sectionsArray)) @foreach($sectionsArray as $section) @php $type = $section['type'] ?? ''; $widget = \V2\Services\LandingSectionsEditor\Services\WidgetRegistry::get($type); $viewName = $widget ? $widget->getRenderView() : ('v2-service-landingsectionseditor::render.' . $type); @endphp @if(!empty($type) && view()->exists($viewName))
@include($viewName, [ 'section' => $section, 'data' => $section['parameters'] ?? [] ])
@endif @endforeach @endif